How Quantum Computing Uses Factorization to Break Encryption

The most significant use case of factorization in quantum computing is breaking the encryption that secures nearly all internet communication today. A quantum algorithm called Shor’s algorithm can find the prime factors of large numbers exponentially faster than any known classical method, and that capability directly threatens the mathematical foundation of RSA encryption, one of the most widely deployed security systems in the world.

Why Factoring Large Numbers Matters

Modern encryption relies on “trapdoor” math problems: operations that are easy to perform in one direction but extraordinarily difficult to reverse without a secret key. RSA encryption works by multiplying two very large prime numbers together. The result is public, but figuring out which two primes produced it is, for a classical computer, practically impossible at large enough scales. Your browser, your bank, and your government all depend on this asymmetry every time data moves across a network.

The security of RSA depends on the size of this number, called the modulus. A larger modulus means stronger encryption, but also slower processing. Current implementations commonly use 2048-bit keys, meaning the number involved has roughly 617 digits. No classical computer can factor a number that large in any reasonable timeframe using existing methods like the number field sieve. That gap between “easy to multiply, impossible to factor” is the entire basis of RSA’s security.

How Shor’s Algorithm Changes the Math

In 1994, mathematician Peter Shor showed that a quantum computer could factor large integers in polynomial time, meaning the difficulty scales manageably as the numbers get bigger. Classical algorithms face exponential scaling for the same task. That difference is the source of quantum computing’s threat to encryption.

The algorithm works by converting the factoring problem into a problem of finding repeating patterns, something quantum computers handle naturally. It starts by putting a set of quantum bits into a superposition, allowing them to represent many values simultaneously. It then applies a modular exponentiation function, essentially calculating remainders of powers, across all those values at once. An inverse quantum Fourier transform extracts the period of the repeating pattern, and from that period, classical math (continued fractions) recovers the prime factors.

The key insight is that quantum superposition and interference let the algorithm test an enormous number of possibilities in parallel, then amplify the correct answer while canceling out wrong ones. A classical computer would need to check candidates one by one.

What This Means for Cybersecurity

RSA isn’t the only system at risk. Shor’s algorithm also solves the discrete logarithm problem, which underpins Diffie-Hellman key exchange and elliptic curve cryptography. Together, these three systems protect virtually all encrypted internet traffic: emails, financial transactions, classified government communications, medical records, and everything secured by HTTPS.

A sufficiently powerful quantum computer wouldn’t just threaten future communications. Intelligence agencies and other adversaries are already using a strategy called “harvest now, decrypt later.” They capture encrypted data today, while it’s still unreadable, and store it with the expectation that a future quantum computer will crack it open. For secrets that remain valuable for decades (military plans, trade agreements, health records, intelligence sources), this makes the quantum factoring threat a present-day problem, not a hypothetical one.

Where Quantum Hardware Stands Today

Current quantum computers are nowhere near powerful enough to break real-world encryption. The largest number factored by quantum hardware so far is the 23-bit integer 8,219,999, broken into 251 × 32,749 by a D-Wave quantum annealer. That’s a far cry from a 2048-bit RSA key.

Estimates for what it would take have dropped significantly over time, though. A 2019 paper estimated that factoring a 2048-bit RSA integer would require 20 million noisy qubits and about eight hours of computation. By 2025, an updated estimate from the same research group brought that down to under a million noisy qubits and less than a week. Current quantum processors have a few thousand qubits at most, so a meaningful gap remains, but the trajectory of improvement is what drives urgency.

The Shift to Quantum-Resistant Encryption

Because the threat is real enough to act on now, the National Institute of Standards and Technology (NIST) began selecting replacement encryption algorithms in 2015. In August 2024, NIST released its first three finalized post-quantum cryptography standards, ready for immediate use. The primary standard for general encryption is based on an algorithm called ML-KEM (Module-Lattice-Based Key-Encapsulation Mechanism), which uses an entirely different class of math.

Instead of relying on the difficulty of factoring numbers, lattice-based encryption depends on geometric problems in high-dimensional spaces, specifically finding the shortest or closest vector in a lattice (a grid-like structure of points). These problems are believed to be hard for both classical and quantum computers. Think of it as replacing a lock that quantum computers know how to pick with one built on completely different mechanics.

NIST is encouraging system administrators to begin transitioning immediately. The agency also continues evaluating backup algorithms in case vulnerabilities are found in the initial selections. The migration is expected to take years, since RSA and related systems are embedded in hardware, software, and protocols across essentially every networked system on the planet.

Why Factorization Is the Defining Quantum Use Case

Quantum computing has promising applications in drug discovery, optimization, and materials science, but factorization holds a unique position. It’s the application where quantum advantage is most clearly defined mathematically, where the real-world stakes are highest, and where it has already reshaped an entire industry (cryptography) before the hardware even exists to execute the threat. The global transition to post-quantum encryption, a multi-year effort costing billions across governments and the private sector, is happening entirely because of what Shor’s algorithm proved on paper three decades ago.