Here, as per the question,
Diffie-Hellman is the key exchange that Eve and
Mel might use to simultaneously agree on a large prime number and
integer.
Let's see, what is Diffie-Hellman key exchange and how
things work.
- The premise of the Diffie-Hellman key exchange is that two
people, Eve and Mel, want to come up with a shared secret
number.
- Eve and Mel agree, publicly, on a prime number P, and a base
number N. Eve will know these two numbers, and it won't
matter.
- Eve chooses a number A, which we'll call her "secret
exponent." She keeps A secret from everyone, including
Mel.
- Mel, likewise, chooses his "secret exponent" B, which he keeps
secret from everyone, including Eve (for subtle reasons, both A and
B should be relatively prime to N; that is, A should have no common
factors with N, and neither should B).
- Then, Eve computes the number and sends J to Mel. Similarly,
Mel computes the number.
J = NA (mod P)
K = NB (mod P)
- The final mathematical trick is that Eve now takes K, the
number she got from Mel, and computes
KA(mod P)
- Mel does the same step in his own way, computing
JB (mod P)
- With this number as a key, Eve and Mel can now start
communicating privately using some other cipher.
Please let me know in the comments in case of any
confusion. Also, please upvote if you like.