How can two strangers agree on a secret while everyone is listening?
Your phone and a website that have never met agree on a secret key in public, and eavesdroppers can't work it out.
▶ Start the storyTwo strangers can agree on a secret in public by using keys that come in pairs. In public-key cryptography, each person has a private key they never share and a public key they can hand out to anyone. Anyone can use your public key to lock a message, but only your private key can unlock it. The public key can be broadcast to the world without weakening security.
Step 1: Make a key pair
A private key you keep, a public key you share.
Step 2: Publish the public key
Anyone may see it; that doesn't weaken security.
Step 3: Others lock messages with it
Anyone can encrypt a message for you.
Step 4: Only you unlock
Only your private key can decrypt it.
This solved a problem as old as secret writing. For most of history, both sides used the same key, so they first had to exchange it safely, through some secure channel. That's impossible when your phone talks to a website it has never met.
The classic way to picture the trick is with paint. Alice and Bob publicly agree on a common colour. Each secretly picks a private colour, mixes it with the common one, and they swap their mixtures in plain sight. Then each adds their own secret colour to the mixture they received. Both end up with exactly the same final colour. An eavesdropper who saw everything would find it very hard to unmix the paints. With huge numbers instead of paint, it becomes impossible even for supercomputers.
Whitfield Diffie and Martin Hellman published such a method in 1976, and the RSA system followed in 1977. Surprise: British government mathematicians at GCHQ had found an equivalent system in secret in 1973. Today these ideas underpin the security of internet connections through standards like TLS.
Quiz me
0/3
Recap
Hand out open padlocks, keep the only key: easy to lock, practically impossible to unlock without the private key.
Surprising fact · The key idea behind RSA started taking shape on a sleepless night after a Passover dinner in 1977.
Connects to
- 🔐 Why is it so hard to split a big number into its primes?
- 🔢 Why do prime numbers never run out?
- 🔒 Why doesn't your favorite website know your password?
- Diffie hellman key exchange
- Transport layer security
Sources (4)
No source, no claim. Every fact in this lesson (16 claims) cites at least one of these.