Classical vs Post-Quantum

The math that secures today's internet — and the new math built to survive quantum computers.

01

Why should a teenager care about quantum computers? 🤔

The Big Idea

Almost everything secret on the internet — your messages, passwords, bank logins, and every cryptocurrency wallet — is locked with math problems that are easy to check but practically impossible to reverse on a normal computer. A large quantum computer changes the rules: it can run brand-new algorithms that crack some of these locks in hours instead of trillions of years. Post-quantum cryptography (PQC) is the new math we are switching to so our locks stay shut.

1030+
years for a classical PC to break RSA-2048
~8 hrs
for an ideal quantum computer (Shor's algorithm)
2024
NIST published the first PQC standards
2256
keys a wallet hides behind — for now
02

Classical math vs Post-Quantum math

Head to Head

Two completely different families of hard problems.

🔐 Classical Cryptography

Security rests on number theory that is hard for ordinary computers.

  • RSA — factoring a huge number n = p·q
  • Diffie–Hellman — the discrete logarithm
  • ECC — the elliptic-curve discrete log
  • Weakness: Shor's algorithm solves all three
VS

🛡️ Post-Quantum Cryptography

Security rests on problems hard even for quantum computers.

  • Lattices — shortest vector / Learning With Errors
  • Hashes — SPHINCS+ signatures
  • Codes — error-correcting code decoding
  • Strength: no known fast quantum attack
03

Two quantum algorithms that change everything

The Threat

① Shor's Algorithm — the lock-picker 🗝️

Shor's algorithm (1994) finds the hidden period of a function using a quantum Fourier transform. That single trick lets it factor big numbers and solve discrete logs in polynomial time — demolishing RSA, Diffie–Hellman and ECC.

# Factoring a number with b bits
Classical (best known, GNFS): exp[ (64/9)1/3 · b1/3 · (ln b)2/3 ]  (sub-exponential)
Quantum (Shor):        O( b2 · log b · log log b )  (polynomial ✅)

② Grover's Algorithm — the speed-searcher 🔍

Grover's algorithm (1996) searches an unsorted space of N items in only √N steps. It does not break symmetric crypto — it just halves the security level, so we respond by doubling key sizes.

Brute-forcing an n-bit key:
Classical: O(2n)  →  Quantum (Grover): O(2n/2)
So AES-128 → only 264 effective. Fix: use AES-256 → back to 2128.
04

What breaks, and what replaces it

At a Glance

Today's algorithmJobQuantum attackStatusPost-quantum replacement
RSA-2048Key exchange / signaturesShorBrokenML-KEM (Kyber), ML-DSA (Dilithium)
ECC P-256Signatures (incl. Bitcoin)ShorBrokenML-DSA (Dilithium), Falcon, SPHINCS+
Diffie–HellmanKey exchangeShorBrokenML-KEM (Kyber)
AES-128Encrypt dataGroverWeakenedAES-256
SHA-256Hashing / miningGroverMostly safeSHA-384 / SHA3-512

Names like ML-KEM and ML-DSA are the official NIST standard names (FIPS 203 & 204) for the algorithms first known as Kyber and Dilithium.

05

Time to break a key 🏁

Fun Graphic

Longer bar = safer. Watch how a quantum computer flattens the classical bars.

RSA-2048 vs classical PC
trillions of years
RSA-2048 vs quantum
~hours
AES-128 vs quantum
264 steps
AES-256 vs quantum
2128 steps
Kyber / Dilithium vs quantum
no fast attack
06

Notation, decoded 📐

The Detailed Math

RSA — factoring

Pick two large primes p and q. The public modulus is their product:

n = p · q    φ(n) = (p−1)(q−1)
public key (n, e)   private key d with   e·d ≡ 1 (mod φ(n))
encrypt: c ≡ me (mod n)    decrypt: m ≡ cd (mod n)

To break it you must recover p and q from n. Shor turns factoring into period finding: find the smallest r with ar ≡ 1 (mod n), which a quantum computer does efficiently.

Elliptic Curves — the discrete log

Points live on the curve y2 = x3 + ax + b (mod p). “Multiplying” a base point G by a secret k is easy; reversing it is the hard ECDLP:

Q = k · G   (easy forward)
given Q and G, find k   (hard backward)
Classical best (Pollard's ρ): O(√n) ≈ 2128 for a 256-bit curve
Quantum (Shor): polynomial → broken

Bitcoin and Ethereum sign every transaction with ECC (secp256k1). This is exactly why people ask whether quantum computers could one day steal coins.

Lattices & Learning With Errors (the PQC hero) 🧩

A lattice is a grid of points stretching through high-dimensional space. Finding the shortest vector is brutally hard — even for quantum machines. Learning With Errors (LWE) hides a secret with a little random noise:

b = A · s + e  (mod q)
A = public matrix   s = secret vector   e = tiny random error
Recovering s reduces to worst-case lattice problems (GapSVP) — believed quantum-hard

Kyber (encryption) and Dilithium (signatures) are both built on this idea. The noise e is what makes the system impossible to “solve like a normal equation.”

Hash-based signatures — SPHINCS+ 🌲

These trust only a hash function. If your hash is secure, your signature is secure — no number theory for Shor to attack. They build a giant tree of one-time keys (a Merkle tree) so one master public key can sign many messages.

07

Security-level calculator 🧮

Try It

Pick an algorithm and see how a quantum computer changes its real security.

Choose an algorithm and press Compute.
08

Migration timeline 🗓️

The Road Ahead

1994–1996
Shor and Grover publish the algorithms that start the whole race.
2016
NIST opens a worldwide competition to design post-quantum algorithms.
2022
Kyber, Dilithium, Falcon and SPHINCS+ are selected as winners.
2024
NIST publishes FIPS 203/204/205 — the first official PQC standards.
Now → 2030s
Browsers, messaging apps and blockchains begin upgrading. “Harvest now, decrypt later” means data stolen today could be cracked once quantum computers mature — so the switch starts early.

💡 Key takeaway

Classical crypto isn't “wrong” — it's just built on problems a quantum computer can shortcut. Post-quantum crypto swaps in problems (lattices, hashes, codes) that both classical and quantum computers find hard. Same goal, tougher math.

CryptoMath AI

Online • Ready to help

Hi! I'm CryptoMath AI, your personal assistant for cryptography and blockchain mathematics. Ask me anything about:

  • Modular arithmetic & prime numbers
  • RSA, SHA-256, ECDSA encryption
  • Blockchain & cryptocurrency concepts
  • Solving math problems step-by-step

AI can make mistakes. Verify important information.