Diffie-Hellman key exchange,a interesting Gate question,help!


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 (
A) 3
(B) 4
© 5
(D) 6


The Diffie–Hellman key exchange method allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure channel.
This key can then be used to encrypt subsequent communications using a symmetric key cipher.


The simplest and the original implementation of the protocol uses the multiplicative group of integers modulo p, where p is prime, and g is a primitive root modulo p.

3^2 mod 2.
2^5 mod 7 = 4.

The D-H key is g^(ab) mod p.

I recommend see wikipedia,very good and exhaustive explanation: