714 views

Suppose that two parties A and B wish to setup a common secret key (D-H key) between themselves using the Diffie-Hellman key exchange technique. They agree on 7 as the modulus and 3 as the primitive root. Party A chooses 2 and party B chooses 5 as their respective secrets. Their D-H key is

1. 3
2. 4
3. 5
4. 6
recategorized | 714 views

For Diffie-Hellman the secret is $g^a^b$ mod p , where g is the prime root ( or generator ) and p is the modulus.

So the answer should be (3^10) mod 7 which is B) 4.
selected
Is this the shortcut to find out the secret key ?

g^a^b mod p

Could u elaborate it more ?

@ashwina,

yes, this is shortcut. because,

R1=g^a mod p    (step 1)                                                                             R2=g^b mod p    (step 2)

R1=3^2 mod 7   =   2                                                                                    R2=3^5 mod 7  = 5

K1=R2^a mod p      (step 3)                                                                         K2=R1^b mod p    (step 4)

K1=5^2 mod 7 = 4                                                                                         K2=2^5 mod 7  =  4

here K1 and K2 are same .  i.e , shared key = g^ab mod p

+1 vote
ans is option (2) i.e k=4

given n=7 r=3 Xa=2 Xb=5

=> Ya=3(pow)2 mod 7 =2

Yb=3(pow)5 mod 7 =5

then d-f key k=Ya(pow)Xb mod 7 or Yb(pow)Xa mod 7

=> k = 2 pow 5 mod 7 =4 (or) 6 pow 2 mod 7 =1