๐Ÿค Diffie-Hellman

๐Ÿ‡บ๐Ÿ‡ฆ UK โ† Back
Step-by-Step Math
Colour Mixing Analogy

๐Ÿ”‘ Diffie-Hellman Key Exchange

Two parties establish a shared secret over an insecure channel using modular exponentiation. A colour-mixing analogy makes the discrete logarithm problem โ€” the one-way function at the heart of DH โ€” intuitive.

๐Ÿ”ฌ What It Demonstrates

Alice and Bob each choose a secret, compute g^a mod p and g^b mod p publicly, then raise the other's public value to their own secret power. Both arrive at g^(ab) mod p โ€” the shared secret that Eve cannot compute without solving the discrete log problem.

๐ŸŽฎ How to Use

Follow the step-by-step protocol: choose primes p and g, pick secrets a and b. Watch the colour-mixing analogy unfold. Try to compute the shared secret from the public values โ€” you'll see why it's computationally infeasible.

๐Ÿ’ก Did You Know?

Diffie-Hellman (1976) was the first published public-key protocol. Whitfield Diffie and Martin Hellman received the Turing Award in 2015. GCHQ's James Ellis and Malcolm Williamson discovered the same idea in 1969 but it remained classified.