Diffie-Hellman Algorithm


How can 2 people who never met agree on a secret key, without a man in a middle always listening, to figure the key out?

Consider a situation with 3 parties, Alice, Bob (the two parties trying to communicate) and Eve, the thief.

Eve is unable to obtain the secret colour because it requires the private colour to obtain.

We use modular arithmetic as the numerical procedure in place of colours for the Diffie-Hellman algorithm.

We choose a prime, and a primitive root, such that \(root^x mod prime\) is uniformly distributed across all possible modulos. Modulo arithmetic is a great example on a one-way function, where computation is easy to perform in one direction, but difficult to perform in reverse.