Post-Quantum Cryptography: How Shor’s Algorithm Breaks Today’s Internet—and What Replaces It

Close-up of electronic microchips on a circuit board representing cryptographic hardware

Right now, undersea fiber-optic cables are carrying your banking logins, medical records, source code, and private messages wrapped in mathematical padlocks designed in the 1970s and 1980s. No quantum computer on Earth today can break those locks. Yet intelligence agencies and well-funded adversaries do not need a working quantum computer today to steal secrets protected by them. They only need cheap storage arrays and patience.

That single realization has triggered the largest cryptographic overhaul since the birth of the commercial web. To understand why the internet is quietly swapping out its foundational math in 2025 and 2026—and why you don’t need to panic about your password manager—we have to look inside the trapdoors that hold HTTPS together, the quantum shortcut that shatters them, and the bizarre high-dimensional geometry stepping in as their replacement.

The Asymmetric Bargain: Why RSA and Elliptic Curves Hold the Internet Together

Modern internet security rests on a clever division of labor. When your browser connects to a bank, it does not encrypt your entire session with public-key cryptography; that would be far too slow. Instead, it uses asymmetric (public-key) cryptography for two brief, critical jobs: verifying who the server is (via digital signatures inside TLS certificates) and agreeing on a shared secret key over an untrusted network. Once both sides hold that shared secret, they hand off the heavy lifting to a fast symmetric cipher like AES-256.

Public-key cryptography only works if you have a mathematical trapdoor function—something effortless to compute forward, yet astronomically hard to reverse without a secret key. For forty years, the web has bet almost everything on two trapdoors:

  • Integer Factorization (RSA, 1977): Multiply two giant 1,024-bit prime numbers p and q together, and a smartphone finishes in microseconds. Hand a supercomputer only their 2,048-bit product N = p × q and ask for p and q back, and the best known classical method (the General Number Field Sieve) would grind for billions of years.
  • Discrete Logarithms & Elliptic Curves (Diffie-Hellman, ECDSA, X25519): Starting from a point on a carefully chosen elliptic curve, “bouncing” around the curve k times is fast. Seeing only the starting point and the final landing point, figuring out how many bounces k occurred is classically intractable—allowing tiny 64-byte P-256 keys to match the classical strength of much larger RSA keys.

Every layer of internet trust—from HTTPS certificates to code signing and DNSSEC validation inside the Domain Name System (DNS)—depends on those two problems staying hard. Unfortunately, both share a hidden algebraic rhythm.

Peter Shor’s 1994 Shortcut—and Why AES-256 Survives

In 1994, Bell Labs mathematician Peter Shor proved something that sent shockwaves through both physics and computer science. A quantum computer does not break RSA by “trying all keys in parallel”—that popular science cliché is flat wrong. If you measure a quantum superposition blindly, you just get one random wrong answer.

Instead, Shor noticed that factoring an integer N reduces to finding the period r of a repeating modular function f(x) = aˣ mod N. On a classical computer, finding that period is just as hard as factoring. On a fault-tolerant quantum computer, you can load the function’s outputs into a superposition and apply a Quantum Fourier Transform (QFT). Just like sound waves in a noise-canceling headphone, wrong periods interfere destructively and cancel out, while the true period r interferes constructively and spikes in probability. Once you measure r, elementary number theory hands you the prime factors in polynomial time. The exact same period-finding trick collapses elliptic-curve discrete logarithms as well.

Worked Intuition: How Period-Finding Factors N = 15 Without Brute Force

Pick a random number a = 7 (coprime to 15) and compute 7ˣ mod 15 for x = 0, 1, 2, 3, 4, 5...: you get 1, 7, 4, 13, 1, 7, 4, 13.... The sequence repeats every r = 4 steps. Because r is even, Shor’s classical post-processing computes gcd(7^(r/2) − 1, 15) = gcd(48, 15) = 3 and gcd(7^(r/2) + 1, 15) = gcd(50, 15) = 5. Out pop the prime factors 3 and 5—without ever testing divisors one by one.

For years, skeptics comforted themselves with the sheer hardware cost of running Shor’s algorithm on real, noisy qubits. In 2019, Google Quantum AI researcher Craig Gidney and Martin Ekerå estimated it would take roughly 20 million noisy physical qubits running for 8 hours to factor RSA-2048. Then in May 2025, Gidney published a striking paper (arXiv:2505.15917) combining approximate residue arithmetic, yoked surface codes, and magic state cultivation. His new estimate slashed the hardware requirement by a factor of twenty: under 1 million noisy physical qubits could factor RSA-2048 in less than a week. No machine of that scale exists yet, but algorithmic breakthroughs keep pulling the finish line closer.

Crucially, however, quantum computers do not break all cryptography equally. Symmetric ciphers like AES-256 and hash functions like SHA-256 have no neat algebraic period for the QFT to exploit. The best known quantum attack against them is Lov Grover’s 1996 search algorithm, which delivers only a quadratic speedup—searching N keys in O(√N) steps. In practice, Grover’s algorithm halves the effective bit strength of a symmetric key: AES-128 drops toward 64-bit quantum security (uncomfortably thin), while AES-256 retains ~128 bits of post-quantum security. Doubling symmetric key sizes neutralizes Grover; no reasonable key-size increase can save RSA or ECC from Shor.

AlgorithmCategoryClassical SecurityBest Quantum AttackPost-Quantum Verdict
RSA-2048Public-key (Factoring)~112 bitsShor’s Algorithm (Polynomial)Broken — replace
ECDSA P-256 / X25519Public-key (Elliptic Curve)128 bitsShor’s Algorithm (Polynomial)Broken — replace
AES-128Symmetric Cipher128 bitsGrover’s Algorithm (Quadratic)Weakened (~64-bit) — upgrade to AES-256
AES-256Symmetric Cipher256 bitsGrover’s Algorithm (Quadratic)Safe (~128-bit quantum security)
ML-KEM-768 / ML-DSA-65Post-Quantum (Lattice)~192 bits (NIST Cat 3)No exponential speedup knownQuantum-Safe Standard

Harvest Now, Decrypt Later—and Mosca’s Inequality

If a Cryptographically Relevant Quantum Computer (CRQC) is still a decade or more away, why are security engineers rushing today? The answer is the Harvest Now, Decrypt Later (HNDL) threat model. An adversary tapping a backbone cable or compromising a cloud backup can quietly archive encrypted TLS handshakes today. Ten or fifteen years from now, when fault-tolerant quantum hardware matures, they simply feed those stored ciphertexts into Shor’s algorithm, recover the session keys, and read yesterday’s secrets in plaintext.

Cryptographer Michele Mosca distilled this urgency into a deceptively simple rule known as Mosca’s Inequality: if X + Y > Z, you are already too late. Here X is your data’s confidentiality shelf-life (how many years a secret must stay secret—decades for genomic records, defense designs, or long-term M&A strategy), Y is the time required to migrate your infrastructure to quantum-safe algorithms, and Z is the years remaining until a CRQC arrives. Notice that even if Z is 15 years away, data requiring 12 years of secrecy inside an enterprise needing 5 years to migrate yields 12 + 5 = 17 > 15. That is why modern business IT security planning and cloud-to-quantum data protection architectures treat post-quantum migration as a present-tense engineering task, not a sci-fi footnote.

Interactive Lab: Compare Key Footprints & Estimate Your HNDL Risk

Switch between the two tabs below. First, inspect how NIST’s post-quantum standards compare against RSA-2048, ECDSA P-256, and AES-256 in byte overhead and quantum resilience. Then open the Mosca’s Inequality calculator to model whether your organization’s data is already inside the HNDL Red Zone.

Interactive Lab

RSA vs. Lattice Comparator & HNDL Risk Estimator

Compare classical and NIST post-quantum cryptographic footprints, then test Mosca’s Inequality (X + Y > Z) to see if your data is already in the Harvest-Now-Decrypt-Later Red Zone.

Role & Math Family
—
—
Key Size
—
—
Ciphertext / Signature
—
—
Quantum Security
—
—
Total Handshake / Artifact Footprint (Key + Ciphertext or Signature, Bytes)
Data Shelf-Life (X) 10 yrs
How long today’s encrypted secrets must stay confidential.
Migration Time (Y) 4 yrs
Years to inventory, upgrade, and certify PQC across systems.
CRQC Arrival (Z) 12 yrs
Estimated years until a fault-tolerant CRQC breaks RSA-2048.
Required Protection Window (X + Y) 14 years
Time Until Quantum Break (Z) 12 years

The New Mathematics: Lattices, Learning With Errors, and NIST’s Standards

To defeat Shor’s algorithm, cryptographers needed hard mathematical problems with no hidden periodic structure for a quantum Fourier transform to latch onto. After an eight-year global competition that vetted dozens of candidates—and watched several promising contenders fall to classical attacks—the U.S. National Institute of Standards and Technology (NIST) finalized its first three post-quantum standards on August 13, 2024:

  • FIPS 203 — ML-KEM (formerly CRYSTALS-Kyber): A module-lattice Key Encapsulation Mechanism, now the primary standard for general encryption and TLS key exchange.
  • FIPS 204 — ML-DSA (formerly CRYSTALS-Dilithium): A module-lattice digital signature standard for authenticating websites, software updates, and documents.
  • FIPS 205 — SLH-DSA (formerly SPHINCS+): A stateless hash-based signature standard that relies solely on cryptographic hash security—serving as an independent mathematical safety net if lattices are ever weakened.

NIST didn’t stop at algorithmic diversity for signatures. On March 11, 2025, NIST selected HQC (Hamming Quasi-Cyclic)—a code-based algorithm built on error-correcting codes rather than lattices—as its fifth PQC standard to act as a backup key encapsulation mechanism, with a final standard targeted around 2027. Meanwhile, NIST’s November 2024 draft transition roadmap (NIST IR 8547) signaled a clear sunset horizon: deprecating quantum-vulnerable public-key algorithms after 2030 and disallowing them entirely after 2035.

How Lattice Cryptography Actually Works (Without a PhD)

Why do ML-KEM and ML-DSA lean on lattices? Imagine a regular grid of dots extending infinitely across a 2D sheet of graph paper. If I hand you two neat, perpendicular arrows (a “good” basis) and drop a pin somewhere on the page, finding the nearest grid dot is trivial. Now imagine I hand you two wildly long, nearly parallel arrows (a “bad” basis) that generate the exact same grid—except instead of 2 dimensions, the grid lives in 500 to 1,000 dimensions. Finding the shortest vector or closest lattice point from a bad basis becomes an astronomical geometric maze for both classical supercomputers and quantum computers.

In 2005, computer scientist Oded Regev turned that geometry into a clean algebraic puzzle called Learning With Errors (LWE). Solving a system of linear equations like 3x + 2y = 11 is high-school algebra; Gaussian elimination solves thousands of variables in milliseconds. Now add a tiny, random sprinkle of noise (say, ±1) to every equation’s output. Suddenly Gaussian elimination explodes—the tiny errors amplify at every step until the solution dissolves into static. Regev proved that cracking LWE is, on average, as hard as solving worst-case lattice geometry problems. Your private key lets you subtract the noise cleanly; an attacker without it drowns in 768 dimensions of static.

The Quiet Migration Already Running in Your Browser and Phone

Unlike Y2K—which arrived with a single midnight deadline—post-quantum migration is already live across billions of devices, largely invisible to end users. Because lattice algorithms are younger than RSA, engineers rarely deploy them alone during the transition. Instead, they use hybrid key exchange, most notably X25519MLKEM768, which combines classical elliptic-curve X25519 with NIST’s ML-KEM-768 inside a single handshake. To break the session, an attacker must defeat both the classical curve and the lattice problem.

Three real-world milestones show how fast key exchange has moved:

  • Apple iMessage PQ3 (February 2024): Shipped in iOS 17.4 and macOS 14.4, PQ3 pairs classical elliptic curves with ML-KEM not only at initial session setup, but continuously during ongoing conversations—providing post-quantum self-healing even if a single key is compromised.
  • Google Chrome & Modern Browsers (2024–2025): Starting with Chrome 131 (followed closely by Firefox, Edge, and Brave), browsers enabled hybrid X25519MLKEM768 TLS handshakes by default for billions of daily web sessions.
  • Cloudflare Edge Infrastructure (2023–2025): By late 2025, Cloudflare reported that the majority of human-initiated HTTPS traffic traversing its global edge network was already protected by post-quantum key agreement.

The hardest engineering friction isn’t CPU speed—ML-KEM is actually faster in raw compute than RSA-2048. The real bottleneck is wire size. An ML-KEM-768 public key (1,184 bytes) plus ciphertext (1,088 bytes) pushes a TLS ClientHello past the classic ~1,500-byte Ethernet MTU, splitting it across multiple TCP packets and exposing brittle legacy firewalls and middleboxes that choke on fragmented handshakes. Even tougher is the second act unfolding across 2026–2030: migrating digital signatures and Public Key Infrastructure (PKI). With ML-DSA-65 signatures running 3,309 bytes—more than fifty times larger than ECDSA P-256—swapping out every root, intermediate, and leaf certificate in a TLS chain requires careful compression, protocol tuning, and hardware security module (HSM) upgrades.

Engineering Checklist: Four Practical Steps Toward Crypto-Agility

1. Inventory before you swap: Map every place your stack uses RSA, ECDSA, or Diffie-Hellman—TLS terminators, VPNs, API signing keys, database encryption wrappers, and third-party SDKs.
2. Turn on hybrid TLS at the edge first: Enabling X25519MLKEM768 on your CDN or load balancer immediately neutralizes Harvest-Now-Decrypt-Later for traffic in transit.
3. Confirm AES-256 and SHA-256/384 for data at rest: Symmetric encryption is already quantum-resilient once you avoid 128-bit keys for long-lived archives.
4. Build crypto-agility into contracts and configs: Never hardcode algorithm OIDs or fixed 256-byte buffer assumptions for signatures; treat algorithms as swappable modules.


Further Reading & Primary Sources

  • Peter W. Shor (1994), Algorithms for Quantum Computation: Discrete Logarithms and Factoring, IEEE Symposium on Foundations of Computer Science (FOCS).
  • Lov K. Grover (1996), A Fast Quantum Mechanical Algorithm for Database Search, ACM Symposium on Theory of Computing (STOC).
  • Oded Regev (2005), On Lattices, Learning with Errors, Random Linear Codes, and Cryptography, STOC 2005 / Journal of the ACM (2009).
  • NIST (August 13, 2024), FIPS 203 (ML-KEM), FIPS 204 (ML-DSA), and FIPS 205 (SLH-DSA), National Institute of Standards and Technology.
  • NIST (March 11, 2025), NIST Selects HQC as Fifth Algorithm for Post-Quantum Encryption; and NIST IR 8547 (Initial Public Draft, November 2024).
  • Craig Gidney (May 2025), How to factor 2048 bit RSA integers with less than a million noisy qubits, Google Quantum AI (arXiv:2505.15917).
  • Apple Security Engineering and Architecture (February 2024), iMessage with PQ3: The new state of the art in quantum-proof messaging at scale.