The problem in two paragraphs
Most of the encryption protecting web traffic, software updates and stored records today rests on two hard problems: factoring large numbers (RSA) and finding discrete logarithms (Diffie-Hellman and elliptic curves). In 1994 Peter Shor showed that a large enough quantum computer solves both in polynomial time.
That matters before such a machine exists. An attacker can record encrypted traffic now and decrypt it later ("harvest now, decrypt later"). In August 2024 NIST published the first post-quantum standards, FIPS 203 (ML-KEM) and FIPS 204 (ML-DSA), built on lattice problems. Most people who will have to migrate have never seen either idea run. This lab lets them.
Every demo here is a toy. It teaches the mechanism with small numbers so you can watch it work. Nothing in this page protects real data.
Experiment 1. Break a lock the way Shor's algorithm does
In plain words: a lock built from a big number N = p × q is safe only if nobody can find p and q. Shor's trick turns factoring into finding how often the pattern of powers ax mod N repeats. A quantum computer finds that repeat length fast. Here a normal computer finds it by brute force, which works for tiny N and fails for real ones.
Why brute force cannot scale
The button below times the same brute-force period search on small semiprimes (products of two primes) and records how many steps each needed.
Experiment 2. Hide a secret in noise
In plain words: imagine a system of linear equations with a secret solution. Solving it is easy algebra. Now nudge every right-hand side by a small random error. Anyone holding the secret can still decrypt, because the errors stay small. Anyone solving the equations gets a wrong answer. That gap is Learning With Errors (LWE), the problem under ML-KEM. Move the sliders and watch where it breaks.
A. Encrypt a message, bit by bit
B. Run 2,000 encryptions and see the noise
C. Attack it with plain algebra
Experiment 3. Count the bytes
In plain words: the new algorithms are not free. A lattice key is a long list of numbers, not a single curve point. These sizes come straight from the published standards, and the "exchange total" is one public key plus one ciphertext (or one signature).
Key exchange
Signatures
Check yourself
About, limits and sources
- Toy parameters. The LWE scheme here uses n up to 32 and q = 3329. Real ML-KEM uses structured module lattices at a much larger scale, and small LWE instances can be broken with lattice reduction. The point of experiment 2 is the role of noise, not a security claim.
- Brute force is not the best classical attack. Real RSA is attacked with the number field sieve, which is far faster than brute-force period finding. Experiment 1 shows why the quantum period-finding step matters, not the cheapest classical route.
- No quantum simulation. The period is found classically. The page never claims a quantum speedup it did not run.
- Sources. NIST FIPS 203 and FIPS 204 (August 2024); RFC 7748; RFC 8032; RFC 8017; Shor, "Algorithms for quantum computation: discrete logarithms and factoring" (1994); Regev, "On lattices, learning with errors, random linear codes, and cryptography" (2005).
- Accessibility. Keyboard operable, every chart has a text table, results are announced to screen readers, and charts never use colour alone.