Alice, Bob and Eve are all present in the classroom. Alice and Bob want to agree on a password that Eve will not be able to know. Eve has access to all communication between Alice and Bob, and Alice and Bob share no common information unknown to Eve. They apply the so-called Diffie-Hellman key exchange protocol (you are not supposed to be familiar with this terminology). This protocol works as follows: First Alice and Bob choose a (large) prime number N and a suitable number g with 2 ≤ g < N.
Then Alice chooses a number 1 < A < N randomly. She doesn’t reveal this number, but keeps this number a secret. Similarly, Bob chooses a number 1 < B < N randomly that he keeps secret. Alice then announces the number g ^A modulo N to Bob (and Eve who is Eavesdropping). Similarly, Bob announces the number g ^B modulo N to Alice (and Eve). The idea in the protocol is that Alice and Bob can both calculate (in a feasible manner) the secret key as the number $$g^{AB} mod(N)$$
a) Explain how Alice and Bob can compute the number g^(AB)modulo N. (Hint: You may assume that Alice and Bob can feasibly compute g C modulo N for any given number C).
My Attempt -
If Alice and Bob can compute g^c mod N then we know that Alice can work out B because Alice knows 3 of the 4 variables to the equation Bob gave. Bob announced the answer to g^b mod N. Alice know's the answer to this equation, g and N. So she can solve for 'b'. Similarly Bob can do the same. Once both they have worked out either A or B, they know their own values so can compute $$g^{AB} mod(N)$$
Would that be correct?
Now they both have the same secret value but Eve does not. They can then calculate g^AB mod N
– TheRapture87 May 05 '16 at 15:20