Interactive
Break a lock yourself: how quantum computers crack encryption
Lock a message with real RSA, crack it the classic way on your own device, watch Shor's trick find the key, then try a lattice puzzle. Five hands-on steps.
Today's locks rest on one hard sum: splitting a big number into two primes. Here you do it with small numbers, step by step.
Break a lock yourself
Five small experiments with real maths, running on your device. The numbers are tiny, so you can watch every step.
With JavaScript on, every number here changes as you move the controls. Without it, you see one worked example.
Lock a message
Type a message, then slide to pick two prime numbers. Everything else follows from those two.
- Public number n
- 61 × 53 = 3233
- Public exponent e
- 17
- Private key d
- 2753
d works because 17 × 2753 leaves 1 when divided by (p − 1)(q − 1) = 3120.
- H72300072
- i1053179105
- ␣32199232
- B6652466
- o1112185111
- b98257098
Locked number = code^e mod n. Unlocked code = locked^d mod n.
Unlocked: Hi Bob
6 letters locked with n = 3233.
What this toy leaves out
Real keys use primes over 300 digits long. This toy also locks each letter on its own, so the same letter always gives the same number. Real RSA locks one random key at a time and adds random padding.
Break it the old way
Everyone can see n. Divide it by 2, 3, 5, 7 and onwards until something goes in evenly. Then you have p and q, and the private key with them.
n = 3233
3233 = 53 × 61, found after 27 tries.
Your key fell instantly. Now make the key bigger and time the same attack on this device.
Press Time it to measure this device.
How the estimate is made
It assumes one core of this device and the worst case: trying every odd number up to √n. Each 2 extra bits double the work. Real attackers use a much faster method, the number field sieve. Scaling its cost formula from the 2020 record (829 bits, about 2,700 core-years) gives roughly 6.3 × 1014 core-years for 2048 bits. The formula drops a correction term, so read that as an order of magnitude.
RSA factoring recordsNumber field sieve costNIST: RSA-2048 gives 112-bit strength
Break it the quantum way
Pick a number a and work out a, a², a³ and so on, keeping only the remainder after dividing by n. The remainders repeat. The length of the repeat, r, gives away the primes.
- 3x mod 3233 returns to 1 at x = 260, so r = 260.
- 3130 mod 3233 = 794
- gcd(794 − 1, 3233) = 61
- gcd(794 + 1, 3233) = 53
- 3233 = 53 × 61
- With p and q, anyone can rebuild d = 2753 and unlock your message: Hi Bob
Found 3233 = 53 × 61.
A normal computer finds r by stepping through x one at a time. For a 2048-bit n, r has hundreds of digits, so the stepping never ends.
A quantum computer does not try each x. It builds a wave over all of them in which the repeat shows up as a strong signal, then measures it. That is the quantum Fourier transform, and it makes this step fast.
Estimated need for 2048-bit RSAunder 1,000,000 noisy qubits, under a week
Largest qubit array built so farabout 6,100, not yet error-corrected
Where things stand
Quantum demos of Shor's method have only factored tiny numbers such as 15 and 21, and they skipped the hard multiplications. The estimate above comes from a 2025 paper. Today no quantum computer is close.
Gidney 2025, the qubit estimateCaltech, the 6,100-qubit arrayWhy 21 has not really been factored
Why lattice locks resist
The new locks hide a secret point behind sums that are each off by a little. Drag the blue ring to find the point where every sum fits.
Clues, on a clock of 17. Each is right give or take 1.
- 16x + 12y ≈ 12does not fit
- 7x + 8y ≈ 7does not fit
- 9x + 12y ≈ 11does not fit
- 3x + 13y ≈ 13does not fit
- 4x + 6y ≈ 5does not fit
Your guess (8, 8): 0 of 5 clues fit.
In two dimensions your eye solves it. Without noise it is even easier: school algebra solves two clean clues at once. Real locks add noise and use hundreds of dimensions.
2 dimensions on a clock of 17: 289 points to search.
ML-KEM-768, the lock browsers now use, has 768 dimensions on a clock of 3,329: about 1.4 × 102705 points.
Shor's method works because ax mod n repeats. Nobody has found a repeat in noisy sums like these that a quantum computer can use at real sizes. The best known attacks, on normal or quantum computers, still slow down exponentially as dimensions grow.
What the toy leaves out
Attackers do not check every point. Smarter methods exist, and the key sizes are set against them: NIST rates ML-KEM-768 about as strong as AES-192. A 2026 paper found a faster quantum method in theory, which its authors say is not practical at ML-KEM's sizes.
NIST FIPS 203 (ML-KEM)Regev's survey of learning with errorsThe 2026 lattice paper
Is your data already at risk?
Attackers can copy locked data today and keep it until a quantum computer can open it. Move the sliders for your own data.
At risk. x + y = 15 is more than z = 10. Data sent from 2026 until your switch in 2031 could be read after Q-Day in 2036.
Where the rule comes from
Michele Mosca's rule: you are safe only if x + y is less than z. A 2025 survey of 26 experts put the chance of Q-Day within 10 years at 28 to 49%, and within 15 years at 51 to 70%. Data already sent with old locks is exposed either way if it must stay secret past Q-Day.
Cite this page
Q-Day Explained. “Break a lock yourself: how quantum computers crack encryption”. 3 December 2026. https://qdayexplained.com/interactive-demo/
CC BY 4.0