Lab 01 · Why it breaks
One-Way Padlock
Quick to lock, hard to unlock. The one idea that most of today's internet security rests on.
Explainer
Watch the idea first.
A padlock that snaps shut in a second, the long search to open it, and why a quantum computer changes that. 1 min 22 s, with captions.
Read the transcript
- Anyone can snap a padlock shut. One hand, one second, no key. Opening it again without the key is a very different job.
- Some arithmetic works the same way. Multiply two primes, 89 and 97, and you get 8,633. One quick step.
- Now go backwards. Given only 8,633, which two primes made it? There is no shortcut. You try primes, one by one, until one divides it. That took 24 tries.
- Add digits, and the search explodes, while multiplying stays a single step. Real keys use numbers more than 600 digits long, far beyond any search.
- The two secret primes are your private key. Their product is your public key. It's safe to show anyone, because reversing it is the slow direction. Much of today's internet security rests on that gap.
- But a large enough quantum computer, running Shor's algorithm, could find those primes far faster. That is why new locks, built on different math, are being standardized. Next: Clockwork Ciphers.
Picture an open padlock on a gate.
Anyone walking past can snap it shut with one hand. No key, no skill, one second. Opening it again is a different job: without the key you are stuck.
Some arithmetic behaves the same way. Going forward takes one quick step. Going backward takes a long search, unless you hold a secret. You are about to feel that difference yourself.
Lock it. Then try to unlock it.
Steps
- 1Snap a lock shutdone
- 2Open a 2-digit lock
- 3Open a 3-digit lock
- 4Open a 4-digit lock
- 5Which grew faster?
Snap a lock shut
Pick two secret numbers. Multiplying them is the lock.
53 × 61 = 3,233 locked in 1 step
Open lock 1 of 3
Someone else made this lock from two secret numbers. Find one of them.
77
All three locks are open. Look at the log and the chart beside it, then answer.
LockedPick a number to test whether it divides the lock.
| Lock | Digits | Steps to lock | Your tries to unlock | Opened with |
|---|---|---|---|---|
| 77 | 2 | 1 | ||
| 437 | 3 | 1 | ||
| 8,633 | 4 | 1 |
Goal
Open all three locks, then say which job grew faster.
0 of 3 locks open.
Computed: the count of primes up to the square root, testing one at a time. One zero-based scale, no minimum bar width. Locking stays at 1 step in every row.
Educational, not for production use. An intuition builder, not a proof. Every number here is computed in your browser.
Lock 1 of 3: 77, locked. 0 tries so far. 0 of 3 locks open.
Now it has a name.
Finish the lab to see the real terms. They will make sense once you have done it by hand.
What you felt is a one-way function: quick to compute, slow to reverse. Multiplying two primes took one step every time. Undoing it is integer factorization, and your tries climbed with each lock.
The two secret primes are a private key. Their product is a public key: safe to show anyone, because reversing it is the slow direction. The RSA system is built on this exact gap.
Why this matters for quantum
A sufficiently capable quantum computer could run Shor’s algorithm, which finds those factors far faster than guessing. That is Lab 03, Shattering the Clock (planned). It is why new locks built on different math are being standardized.
Explain it to a colleague.
What a good answer covers
- To doOne direction is quick, the other is slow.
- To doA secret makes the slow direction quick.
- To doWhere the padlock picture stops working.