Two people (Alice & Bob) agree on a shared secret over a public channel — without ever transmitting the secret itself. Even an eavesdropper (Eve) who sees everything cannot recover it.
This demo shows both the math (modular exponentiation) and the paint analogy (mixing colors is easy; un-mixing is hard).
Public values — visible to everyone, including Eve
Alice's private secret — known only to Alice
Bob's private secret — known only to Bob
Shared secret — derived independently, identical result
Eve — can intercept messages but cannot compute the secret
Click Next Step to advance manually, or Auto Play to animate. You can change secret values in the parameter cards below.
Diffie-Hellman Key Exchange
Cryptographic key agreement over an insecure channel