0% found this document useful (0 votes)
4 views1 page

Cryptosystem Security and Key Exchange

This document contains instructions for Assignment 3 in COMPSCI 3IS3. It consists of 3 questions: 1. Explain why the key sizes of some cryptosystems are significantly larger than their security parameters. 2. (a) Run the Extended Euclidean Algorithm on input 110 and 625 and write down the values at each iteration. (b) Implement the algorithm in Python for much larger inputs and write down the final values. 3. (a) Explain how an attacker could recover an AES key K from K^e if e is too small in an RSA key exchange. (b) Describe an improved protocol that hashes a random element m from Z_n to derive the shared

Uploaded by

ibrahimango3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Cryptosystem Security and Key Exchange

This document contains instructions for Assignment 3 in COMPSCI 3IS3. It consists of 3 questions: 1. Explain why the key sizes of some cryptosystems are significantly larger than their security parameters. 2. (a) Run the Extended Euclidean Algorithm on input 110 and 625 and write down the values at each iteration. (b) Implement the algorithm in Python for much larger inputs and write down the final values. 3. (a) Explain how an attacker could recover an AES key K from K^e if e is too small in an RSA key exchange. (b) Describe an improved protocol that hashes a random element m from Z_n to derive the shared

Uploaded by

ibrahimango3
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

COMPSCI 3IS3 - Assignment 3

1. (10 marks) Recall the concept of security level for a cryptosystem. We say that a system
provides λ bits of security, if the best known attack against the system takes Ω(2λ )
operations. The integer λ is sometimes called the security parameter. Explain why the
key sizes of some cryptosystems are significantly larger than their security parameters.
2. (30 marks)
(a) Run the Extended Euclidean Algorithm for the inputs r0 = 110 and r1 = 625. Write
down the values ri , si and ti for each iteration.
(b) Implement the Extended Euclidean Algorithm in python3. Run your algorithm on
the input
r0 = 164554569211088430770706425287401139967,
r1 = 316812464220963669296170073138677641820785101655675695
What are the final r, s, and t for the above input?
3. (60 marks) In the class we talked about how we can perform a key exchange using a
public-key scheme: To share a secret K with Bob, Alice encrypts K using Bob’s public
key and sends the ciphertext to Bob. Bob uses his private key to decrypt the ciphertext
and recover K. Now they both have K. They can use K as a key to communicate using
a much faster symmetric-key scheme such as AES.
(a) Suppose the public-key scheme used above is RSA. Bob’s public key is (n, e) where
n is the modulus. In practice, n is usually a 2048-bit integer, and e is small. To
share an AES key K, Alice computes y = K e mod n, and sends y to Bob. Bob uses
his private key d to computes y d = K ed = K mod n. Now, for an AES key, K is
128 bits. If e is small enough, say smaller than 16, then K e < n. This means, no
reduction mod n happens in computing K e . This is dangerous! Remember that K e
is transmitted publicly, so, everybody can access it. Explain how Trudy can recover
K from K e .
(b) One way to prevent the situation in (a) is to use larger integer, i.e., an element of Zn ,
for encryption. To do this, Alice can use a secure hash function H that has 128-bit
outputs. In this case, instead of encrypting K, Alice encrypts a random element m
from Zn , and chooses H(m) as the shared key. Write down the new key-exchange
protocol. Remember, H is a publicly known hash function, so, Bob and everybody
else can use it. Explain why Trudy cannot break this new scheme.

Common questions

Powered by AI

Symmetric-key cryptography, like AES, relies on a shared secret key for encryption and decryption, offering efficient and fast data processing. However, it requires a secure method for exchanging keys, which can expose vulnerabilities. Public-key cryptography, like RSA, allows secure key exchange over public channels by using paired public and private keys, removing the need for a pre-shared secret. Despite being slower, public-key systems provide a scalable solution to secure communications, particularly for authentication and key distribution in open networks. Each system has its trade-offs, where symmetric-key cryptography is more efficient in processing data but less secure in key distribution, while public-key cryptography offers robust key management but is computationally intensive.

Reducing Ke mod n is crucial because it ensures the integrity and secrecy upheld by RSA cryptosystems. Without this reduction, small exponent values could result in unmodulated outputs accessible within smaller fields, exposing plaintext values directly through simple root calculations. Modular arithmetic underpins the security of RSA by maintaining operations within a finite field, obfuscating the relationship between ciphertext and plaintext, and preventing direct extraction of sensitive data by observers.

To prevent Trudy from easily recovering the AES key, Alice can avoid encrypting the AES key directly. Instead, she can first select a random element m from the group Zn and then compute the hash H(m) to use as the shared key. Alice encrypts m with Bob's RSA public key and transmits the ciphertext. Since m is chosen from Zn and larger than typical key values, it ensures Ke is appropriately reduced modulo n, hindering Trudy's ability to directly compute the e-th root. The hash abstraction further obscures the direct mapping to the shared key.

Using a small integer exponent in RSA encryption, while computationally efficient, reveals potential vulnerabilities such as the ability to derive plaintext messages by computing simple exponentiation without modulus reduction. This weakness arises from the possibility that Ke < n, allowing attackers to compute e-th roots of public values directly. Mitigation includes using larger exponents to ensure adequate modulo reduction or implementing padding schemes such as Optimal Asymmetric Encryption Padding (OAEP), which standardizes the input format for cryptographic resilience. Leveraging provably secure padding ensures that even with small exponents, the message integrity is maintained.

Even with large key sizes, cryptosystems can introduce vulnerabilities through improper implementation, such as using weak algorithms, inadequate entropy or randomness in key generation, and failing to incorporate comprehensive padding techniques. A cryptosystem can be sound in theory but fall prey to practical attacks if operational parameters, like key management or side-channel protections, are not meticulously followed. Larger keys do increase brute force resilience but cannot compensate for architectural weaknesses or missteps in cryptographic protocol application.

When Alice encrypts an AES key K using RSA with a small exponent e, if Ke < n, then the encryption result Ke is transmitted without being reduced modulo n. In this case, since Ke is publicly accessible, Trudy can simply compute the e-th root of Ke to directly recover K if Ke is smaller than n. This vulnerability arises because the modulus operation, essential to RSA's security, doesn't affect small exponentiations, exposing the plaintext to potential recovery.

The Extended Euclidean Algorithm computes the greatest common divisor (GCD) of two numbers while also finding coefficients (often denoted as s and t) such that a linear combination of these two numbers equals the GCD. This is useful not only for finding the GCD but also for applications in number theory, such as finding modulo inverses in computational cryptography.

In the modified key exchange protocol, the hash function improves security by generating a shared key that is computationally unrelated to the encrypted random element m transmitted over insecure channels. Since H(m) is used as the shared key and hashing is a one-way operation, it prevents anyone with access to the encrypted message from directly inferring the plaintext or the shared secret. The security relies on the collision resistance and preimage resistance properties of the hash function, meaning that even with H(m) publicly known, deducing m or finding another input that hashes to the same output is infeasible.

Running the Extended Euclidean Algorithm on these large inputs involves iterative computation that results in expressing the greatest common divisor as a linear combination of r0 and r1, represented by the final values r, s, and t in respective iterations. The process is computationally intensive and requires meticulous step-by-step execution of the algorithm's loop to determine the values. Due to document specifics, the exact values can only be calculated programmatically following the algorithm's structure for extensive integers.

Key sizes are often significantly larger than security parameters because the security parameter, which indicates the computational difficulty to break the system (expressed as λ bits implying Ω(2λ) operations), grows more slowly than the actual key size needed to achieve this difficulty. In asymmetric cryptosystems, such as RSA, the mathematical structures used (e.g., prime factorization) require much larger key sizes to reach equivalent security levels compared to symmetric cryptosystems. This is due to advancements in algorithms that reduce the computational effort needed for attacks, necessitating larger keys to maintain the desired level of security.

You might also like