1. Alan and Bill agree (through a public exchange) on using theDiffieHellmanalgorithm to create a common secret key. They also agree on twopublic numbers: q (large prime number), (generator mod q):
q = 7, = 2
Alan generates a random CA =5, use CA to calculate DA and then sends DA to Bill.
Bill generates a random CB =6, use CB to calculate DBand then sends DB to Alan.
a. What is DA? (i.e. DA =?) (5 points)
b. What is DB? (i.e. DB =?) (5 points)
c. What is the common secret key betweenAlan and Bill? (5 points)
(Note you must show step by step calculation procedures)
4. Consider the following login protocol.
User knows password P
User knows Hash function H(.) and has a mobile calculator
User gives login name N to machine
Machine generates random number R
Machine gives R to user
User computes X:= Hash(P) XOR Hash(R)
User gives X to machine
Machine uses N to obtain P from password table
Machine computes Y:= Hash(P) XOR Hash(R)
If X=Y then machine allows login
a. Explain what is wrong with it and how can it be broken. (7 points)
b. Show a simple way to strengthen this protocol against your attack. (8 points)
5. If we choose two prime numbers p=13 and q=17 in RSA (Rivest-Shamir-
Adelman) algorithm, and choose Public Key = (p x q, e) = (221,5),
a.Show the result and procedures to generate Private Key. (5 points)(b) Show the procedures using the Public Key and the Private Key found in step (a) to encrypt a message M (Assume M=25); and to decrypt for obtaining the message. (10 points)