← All modules
Foundations·11 min

Why quantum computers break this: Shor's algorithm

The bridge module: why everything above is called "classical" cryptography, and exactly what a future quantum computer would do to it.

Executive / Business LeaderDeveloper / EngineerSecurity ArchitectResearcher / AcademicCurious Explorer

The specific mathematical trapdoor

RSA, Diffie-Hellman, and ECC all rest on problems classical computers cannot solve efficiently: factoring large integers, and computing discrete logarithms (in modular arithmetic or on elliptic curves). Every key size recommendation in this catalog is calibrated against the best known classical algorithms for these problems.

In 1994, mathematician Peter Shor published a quantum algorithm that solves both integer factorization and discrete logarithms in polynomial time — meaning the running time grows manageably with input size, unlike the sub-exponential or exponential growth classical algorithms face. On a sufficiently large, sufficiently low-error quantum computer, Shor's algorithm would make RSA, classical Diffie-Hellman, and ECC/ECDSA all breakable in practical time.

Shor: O((logN)2(loglogN)(logloglogN))vs.GNFS: O ⁣(e1.9(logN)1/3(loglogN)2/3)\text{Shor: } O\big((\log N)^{2}(\log\log N)(\log\log\log N)\big) \quad\text{vs.}\quad \text{GNFS: } O\!\left(e^{1.9(\log N)^{1/3}(\log\log N)^{2/3}}\right)

Shor's quantum running time grows polynomially with the number's size N; the best classical factoring algorithm (GNFS) grows sub-exponentially — the gap that makes large keys "safe" classically and irrelevant quantumly.

"Sufficiently large" is doing a lot of work

Breaking RSA-2048 with Shor's algorithm is estimated to require several thousand logical (fully error-corrected) qubits — which, given current error rates, could require millions of physical qubits once error correction overhead is included. Today's largest quantum computers have on the order of hundreds to low thousands of physical, noisy qubits. No quantum computer today can run Shor's algorithm against real-world key sizes.

That gap doesn't mean the risk is purely theoretical for now, though — see the next module on why data encrypted today can already be at risk.

What doesn't break

Symmetric algorithms (AES) and hash functions (SHA-2, SHA-3) are not vulnerable to Shor's algorithm — there's no known efficient quantum algorithm for brute-forcing a symmetric key or finding hash collisions beyond Grover's quadratic speedup, which is countered simply by using larger keys (AES-256 instead of AES-128).

This is the exact fault line PQC standards draw: NIST's post-quantum standards (ML-KEM, ML-DSA, SLH-DSA) replace the public-key algorithms covered in this catalog — RSA, Diffie-Hellman, ECC — while leaving AES and SHA-2/3 in place, just with larger key sizes where needed.

Broken by Shor's algorithm

  • RSA (factoring)
  • Classical Diffie-Hellman (discrete log)
  • ECC / ECDSA (elliptic curve discrete log)
  • Effectively 0-bit security at any key size, once a large enough quantum computer exists

Only weakened by Grover's algorithm

  • AES (symmetric encryption)
  • SHA-2 / SHA-3 (hash functions)
  • Security level roughly halves — AES-256 still gives ~128-bit quantum-resistant security
  • Fixed by using larger keys, not by replacing the algorithm

Knowledge check

Test what you just learned →

3 quick questions, with an explanation for every answer.

Up next

Harvest now, decrypt later: the risk that's already here

You don't need a working quantum computer today to be at risk today. Anything encrypted now with RSA or ECC can simply be recorded and decrypted later.