Question 1
Alice uses the RSA Crypto System to receive messages from Bob. She chooses:
p=13, q=23. Her public exponent e=35. Alice published the product n=p*q=299
and e=35.
a) Check that e=35 is a valid exponent for the RSA algorithm
-For the next questions use d=83
b) Bob wants to send to Alice the encrypted) plaintext P=15. What does he
send to Alice?
c) Verify she can decrypt this message
Question 2
This problem is about El-Gamal encryption in the subgroup generated by g = 2 and n=47.
a) Your secret key is s = 9. Compute your public key.
b) Alice’s public key is PA = 14. Use the random nonce r = 3 to encrypt the message m =
27 to Alice.
Question 3
In Diffie-Hellman key exchange, each user chooses a private X, calculates a public Y ,
and after exchanging Y , calculate K where for user A:
• Ya = αXa mod q
• Ka = YbXa mod q
• q is a prime number, Xa < q, and α is a primitive root of q
You and other users have agreed to use the public values q = 11 and α = 2. You
just received a message from Steve containing his public value, Yb = 9. You choose a
private value Xa = 8.
(a) What public value will you send to Steve? Show calculations.
(b) What secret will you share with Steve? Show calculations.
Assume Thanaruk has intercepted the packets used in the Diffie-Hellman key
exchange between you and Steve.
(c) Show the steps Thanaruk takes to determine Steve’s private value.
(d) What value(s) are recommended to ensure Diffie-Hellman key exchange is
secure,i.e. so Thanaruk could not determine the secret shared between you
and Steve?
(e) Prove that both users (e.g. you and Steve) obtain the same key when using
DiffieHellman. Note a proof does not use specific values such as 2 and 9, but it
instead should refer to variables, such as α and Yb.
For the following question(s), assume appropriate values were chosen for the
DiffieHellman key exchange (i.e. those you recommended above).
(f) Explain how a malicious user Thanaruk (user C) can perform a man-
in-the-middle attack on two users (A and B) that perform a Diffie-Hellman key
exchange. You may use a diagram to illustrate the attack. You should use the
variables (e.g. Yb, α) in your description (don’t use the values such as 2 and 9
from the above questions).
Question 4
Consider the mechanism illustrated in Figure 1.
Figure 1: Security mechanism 1
(a) What is a security service that this mechanism provides?
(b) Explain (or define) the one-way property (also called pre-image resistant
property) of a hash function.
(c) Explain how an attacker can defeat the above security service if the function
H() did not have the one-way property.
Consider the mechanism illustrated in Figure 2
Figure 2: Security mechanism 2
(d) What is a security service that this mechanism provides?
(e) Explain (or define) the weak collision resistant property (also called second
preimage resistant property) of a hash function.
(f) Explain how an attacker can defeat the above security service if the function
H() did not have the weak collision resistant property.
(g) What is the difference between a hash function and a MAC function?