You tapped your card. A padlock icon appeared. Nothing happened.
Except that something remarkable happened. Your card and the bank's computer had never met before — yet they agreed on a secret code, in public, with anyone free to listen in. Every eavesdropper on the network heard everything… and learned nothing.
How do two strangers agree on a secret while shouting across a crowded room?
Some doors lock easily but need a special key to open.
Multiply two prime numbers: easy. 61 × 53 = 3233 — you could do it on paper. Now go backwards: which two primes multiply to 3233? Suddenly you're searching. Make the number not 4 digits long but 617 digits, and the search would outlast the universe — even for every computer on Earth working together.
That one-way street is the padlock. Anyone can lock a message with your public number; only you, knowing the two secret primes, can unlock it. This is RSA encryption, published in 1977, and it guards most of the money on Earth.
Show me the actual maths
n² steps — a 617-digit product is trivial. But the best known factoring algorithms grow sub-exponentially: for a 617-digit (2048-bit) number, the general number field sieve needs more operations than there are atoms in the observable universe multiplied by the age of the universe in seconds. No one has proved factoring must be hard — that's related to the P vs NP problem, one of mathematics' great open questions. The world's money is protected by a conjecture.
Primes have been studied for 2,300 years — for no practical reason at all.
Around 300 BC, Euclid proved there are infinitely many primes, in six lines, purely because it was beautiful. For the next two millennia, number theory was mathematics' art gallery: admired, adored, and famously useless. Mathematicians took a kind of pride in that.
Show me Euclid's six lines
p₁, p₂, …, pₙ. Multiply them all together and add one: N = p₁·p₂·…·pₙ + 1. Dividing N by any prime on our list leaves remainder 1 — so N's prime factors aren't on the list. The list was incomplete. Contradiction — so the primes never end. (~300 BC, still taught essentially unchanged.)
In 1940, the world's leading number theorist made a boast.
Hardy loved number theory because it was useless — "gentle and clean", untouched by war and money. He died in 1947, certain of it. Within three decades, his gentle subject was securing the world's banks, militaries and governments. And keep an eye on the other half of that sentence — "or relativity". It's about to come back.
The record: Clifford Cocks, a mathematician at Britain's GCHQ, had worked out an equivalent system in 1973 — and it was classified. He couldn't tell anyone for 24 years, watching others get famous for it. Declassified only in 1997. Even the history of "useless" mathematics turns out to be a spy story.