Interactive · §11
Lock Lab: Try to Break RSA-2048 Yourself
Four acts. In the first you build a lock. In the second you pick a small one. In the third you try the real thing. In the fourth you find out what would actually open it.
runs in your browser · nothing is uploaded · no account
Act 1 · the lock is not a secret
Two primes in, one number out
Generate a key pair. p and q are primes. Their product n is the lock. Anyone may hold n; only the holder of p and q can open it. Keep the numbers small here so it runs instantly — the structure is identical at 2048 bits.
Everything after this line is done with the public number only.
Publishing n gave nothing away, because encryption is the act of closing a lock. The private key is not the password to n; it is the other half of a mathematical pair. Write p and q down — Act 2 uses them.
Act 2 · the toy breaks
Factor 11413
A key far too small to protect anything: n = 11413. The attack is the dumbest one available — try every odd number up to the square root. It works, and that is the point.
| Modulus | Digits | Trial-division steps | Verdict |
|---|---|---|---|
| 11,413 | 5 | 106 | instant |
| 4,294,967,291 | 10 | ~32,000 | milliseconds |
| 261 − 1 | 19 | ~109 | hours to days |
| RSA-2048 | 617 | ~10300 | never |
The steps double every time you add a digit. Five digits is 106 steps; 617 digits is more steps than there are atoms in the observable universe. This is why the wall in Act 3 is not a wall of difficulty but of arithmetic.
Act 3 · the wall
617 digits, and one very honest progress bar
This is a real 2048-bit RSA modulus, generated for this page. It is the number your browser has been juggling all morning. Start the attack and watch what actually happens to the fraction of work completed.
————The progress bar is not animated for effect. It cannot move: at any display precision you can read, the completed fraction after a minute is zero. That is the whole result of this act.
Experiment report
Copied. The link carries a small ciphertext after the #, which browsers never send to a server.
Act 4 · the switch
Shor, 1994
Same modulus. Same machine. A different mathematical world. Turn it on and watch the number on the dial change sides.
Nothing was cracked. The number collapsed because the problem changed, not because the machine got faster. Shor's algorithm does not search harder; it finds the period, and the period gives the factors.
No quantum computer able to run this exists. The requirement is a fault-tolerant machine with millions of physical qubits, and published resource estimates have been revised downward twice without a machine being built. That gap — between a proof and a device — is the entire subject of this site.
So what did the 2026 papers actually do? →Teaching model, simplified on purpose. Time estimates use a GNFS cost curve calibrated at 250 digits to the RSA-250 record (2,700 core-years, 2020) and extrapolated. Not a cryptanalytic result.
Why a game, and why this one
Because the single most useful thing you can learn about RSA is how lopsided the arithmetic is. Reading “2048-bit” tells you nothing. Watching a progress bar sit at 0.000…% for the one attempt your computer can make in a second tells you something you will remember.
The four acts
Act 1 — Build a lock. You generate a key pair in front of you: two primes, their product, a public exponent, a private exponent. You encrypt a short message with the public half and decrypt it with the private half. Then you publish the public half and see that publishing it gave nothing away, because encryption is the act of closing a lock, not opening one.
Act 2 — Break a toy. A separate lock with a 32-bit modulus, built so that it can genuinely be factored. You try trial division and watch it succeed, then watch the same method crawl when the number grows by a few digits. The lesson is not that factoring is easy; it is how fast easy stops.
Act 3 — Hit the wall. The real 2048-bit modulus, printed as 617 digits, laid out on screen. You start the attack. A progress bar appears. It does not move, because the fraction of the work completed in the time elapsed is below any sensible display precision. The panel underneath extrapolates from your machine's actual measured speed, using a simplified GNFS model calibrated to the RSA-250 factoring record of 2020 — about 2,700 core-years for 250 digits. For 617 digits it returns a number with far too many zeros to read comfortably.
Act 4 — The switch. Turn on Shor's algorithm, 1994. The same modulus, the same machine, and the time collapses from “longer than the universe” to something that fits on a dial. Nothing was cracked; a different mathematical world was entered. The only exit from this act leads to the technical record, because the obvious next question — is this real — deserves a page rather than a punchline.
The honest disclaimer
The time estimates here come from a simplified model of the general number field sieve. Real cryptanalytic cost estimates involve sieving, linear algebra and a lot of constants that this page deliberately leaves out. The model is calibrated at 250 digits and extrapolated, which is the right way to build a teaching tool and the wrong way to build a security assessment. If you need the second thing, read the primary literature linked from /sources.
Sharing
At the end of Act 3 you get an experiment report — a plain card with the modulus size, your machine's measured rate, the extrapolated time and the date. It is a report, not a trophy, because the result is a fact about arithmetic rather than an achievement. There is also a challenge link: a small ciphertext and its key identifier, encoded in the URL fragment after the #, which means it never reaches a server. Send it to someone and they can try the same lock.
No counters, no rankings, no “1,234 people have tried this”. Those numbers would be easy to fabricate and would make the honest number next to them less believable.
Questions people ask
Did anything I typed get uploaded?
No. The whole lab is JavaScript running in this tab. There is no server endpoint, no account, and no storage. Close the tab and the experiment is gone.
The progress bar did not move. Is it broken?
It is working exactly as intended. At the fastest rate any single machine can manage, the fraction of the 2,048-bit problem solved in a minute is far below the precision the bar can display. That is the result.
Why is the Act 1 key only about 19 digits?
Because generating a real 2048-bit key in JavaScript takes long enough to be a bad first experience, and the structure is identical at any size. The 617-digit number in Act 3 is a genuine 2048-bit modulus, generated for this page.
How accurate is the extrapolated time?
Order of magnitude only. It uses a simplified GNFS cost curve calibrated at 250 digits to the RSA-250 record of 2020 and extrapolates from there. Real estimates involve sieving, linear algebra and constants this model omits. It is a teaching estimate, not a cryptanalytic result.
Does the quantum switch mean RSA is broken?
No. It means a different algorithm would solve the problem if a machine capable of running it existed. Shor's algorithm needs a fault-tolerant quantum computer with millions of physical qubits, and no such machine exists. Read /what-anthropic-found for what was and was not demonstrated in 2026.
Can I share a lock with someone?
Yes. Act 3 generates a challenge link containing a small modulus, a public exponent and a ciphertext, encoded after the # so browsers never transmit it. The recipient factors the small modulus and reads the message. It is a demonstration, not a secure channel.