Basics

Shor Breaks RSA and ECC, Grover Leaves AES-128 Standing

Marvin Sprey

Marvin Sprey

ML-DSA-65NIST FIPS 204
Verify →

doc: gizgh7kvf9wms6wuzbl8i00k

sig: 755969bd…12151c26

Minutes Versus a Decade

In late March 2026, Ryan Babbush, Craig Gidney, Dan Boneh and co-authors posted a preprint with a new cost estimate for Shor's algorithm: a discrete logarithm on a 256-bit elliptic curve takes fewer than 1,450 logical qubits and fewer than 70 million Toffoli gates. On superconducting hardware, that comes to fewer than half a million physical qubits and a runtime of minutes.

Three weeks later, Filippo Valsorda ran the same kind of numbers in a blog post for AES-128 and Grover's algorithm. His result: roughly 140 trillion quantum circuits of 724 logical qubits each, running in parallel and without interruption for ten years. Measured against the elliptic-curve estimate, attacking AES-128 is about 2^(78.5) times more expensive, or roughly 430 sextillion.

That's 23 orders of magnitude between two quantum attacks on cryptography in use today. It's why AES-128 doesn't need replacing in the move to post-quantum cryptography, and the reasons lie in how the two algorithms work.

What Shor Breaks

In the mid-1990s, Peter Shor showed that a quantum computer can factor integers and compute discrete logarithms in a number of steps that grows only polynomially with the size of the input. RSA rests on the first problem. Diffie-Hellman and elliptic-curve schemes such as ECDH and ECDSA rest on the second. Germany's Federal Office for Information Security (BSI) states in its technical guideline TR-02102-1 that, given a sufficiently large quantum computer, Shor's algorithm solves both problems efficiently and so breaks the classical schemes for encryption and key establishment.

Breaking here means computing the private key from the public one, and longer keys only make that polynomially more expensive. So the migration replaces these schemes instead of lengthening their keys.

No such cryptographically relevant quantum computer (CRQC) exists yet, but estimates of what it would take keep falling. For RSA-2048, a 2019 paper Gidney co-authored arrived at 20 million noisy qubits, Gidney alone in May 2025 at fewer than a million, with a runtime under a week. Then there's harvest now, decrypt later (HNDL), which the TR calls "store now, decrypt later": anyone recording encrypted traffic today can decrypt it once the machine exists. For that reason, the BSI recommends classical key establishment on its own only until the end of 2031, or the end of 2030 for very high protection needs. The Q-Day timeline on Beyond Shor puts the question of when a CRQC might arrive in context.

In the Beyond Shor playground, the Shor switch in the attacker view lets you play through where a quantum computer strikes in a hybrid handshake made of X25519, a KEM, HKDF and AES-256-GCM.

What Grover Does

The Square Root

In 1996, Lov Grover published a quantum algorithm that finds the one marked item among N possibilities in about √N steps. Classically, you have to try half of them on average. In 1997, Christof Zalka proved that Grover's algorithm is optimal and that getting a near-certain answer takes this many calls:

Oracle calls ≈ π/4 · √N

The oracle is a quantum circuit that checks whether a candidate key turns a known plaintext into the known ciphertext. For AES-128, N = 2¹²⁸ and its square root is 2⁶⁴. That's the source of the common reading that AES-128 offers only 64 bits of security against quantum computers. The 2015 recommendations of the EU project PQCRYPTO, co-authored by Daniel J. Bernstein, say exactly that. The reading assumes one quantum computer doing the 2⁶⁴ steps in sequence, which at one microsecond per step takes about 585,000 years.

Why Parallelization Eats the Square Root

Classical key search splits up as much as you like. Valsorda shows it with 64 bits: at 5 nanoseconds per attempt, one CPU needs about 3,000 years for 2⁶⁴ keys. Spread across 2¹⁶ = 65,536 CPUs, each one checks only 2⁴⁸ keys and is done in 16 days. The total work stays at 2⁶⁴.

With Grover, this backfires. Split the AES-128 key space across 2¹⁶ quantum computers and each one searches 2¹¹² keys, which takes √(2¹¹²) = 2⁵⁶ steps. The factor of 2¹⁶ sits under the square root and saves each machine only 2⁸. Total work rises to 2¹⁶ · 2⁵⁶ = 2⁷². In general, with 2ᵏ machines:

Total work = 2ᵏ · √(2¹²⁸ / 2ᵏ) = 2^(64 + k/2)

Every doubling of the machine count raises total work by a factor of √2, and Zalka's proof also rules out a smarter way to split the search. Bernstein and Tanja Lange stated the general form in a 2017 survey published in Nature. If only time T is available, Grover needs at least N/T evaluations spread across N/T² quantum processors:

Evaluations ≥ N/T, processors ≈ N/T²

The less time, the more machines, quadratically more. Against classical search at N evaluations, that leaves an advantage of a factor of T, which quantum overhead could wipe out. Bernstein and Lange consider it possible that Shor's algorithm will one day run successfully while Grover's stays useless.

Valsorda's Numbers

Valsorda picks assumptions that favor the attacker: fast-clock superconducting qubits at one microsecond per gate, running for ten years straight. That allows a maximum depth, meaning a sequence of gates executed one after another, of about 2⁴⁸. The oracle is an AES-128 circuit from a paper by Haoyu Liao and Qingbin Luo at ASIACRYPT 2025, from which he takes a depth of 232 T gates and a width of 724 logical qubits. The question is how many parallel machines x it takes for each to finish within ten years:

π/4 · √(2¹²⁸ / x) · 232 = 2⁴⁸ ⇒ x ≈ 2⁴⁷

The left side is the depth one machine needs for its share of the key space, Grover steps times oracle depth, and the right side is what ten years allow. The answer is 2⁴⁷, about 140 trillion circuits. Valsorda measures cost as depth times width, or time times qubits, and gets about 2^(104.5). For the elliptic-curve attack he uses 70 million gates, about 2²⁶. The gap is 2^(78.5).

Bernstein and Lange's formula shows what's left. Each machine manages about 2⁴⁰ oracle calls in ten years, about 2⁸⁷ in total, compared with up to 2¹²⁸ AES evaluations for classical search. On paper, that's an advantage. But every call is an error-corrected quantum circuit, and Valsorda's numbers leave out the cost of error correction entirely.

Samuel Jaques of the University of Waterloo included it in a 2024 talk, at roughly 2¹⁶ physical operations per logical operation in a surface-code architecture. With an allowed depth of 2⁴⁰, a parallel Grover attack on AES-128 then takes at least 2¹³⁶ quantum operations, against 2¹⁴³ for classical search. What's left of the square root is a factor of about 2⁷, bought with technology that doesn't exist. His conclusion: "Grover's algorithm will not break AES-128 in our lifetimes, and will probably never break it."

What the Authorities Say

The U.S. National Institute of Standards and Technology (NIST) uses AES as the yardstick for post-quantum schemes, with security category 1 matching the cost of key search on a block cipher with a 128-bit key such as AES-128. Its post-quantum FAQ cites Zalka and the serial nature of Grover's algorithm and concludes that "it is quite likely that Grover's algorithm will provide little or no advantage in attacking AES, and AES 128 will remain secure for decades to come." Applications can keep using AES with 128, 192 or 256-bit keys. The November 2024 draft NIST IR 8547 lists AES-128 in category 1, and NIST says it doesn't expect to move away from its symmetric standards as part of the post-quantum migration.

The BSI is more cautious. Version 2026-01 of TR-02102-1 recommends AES-128, AES-192 and AES-256 for new systems. Grover could theoretically speed up key search quadratically, it says, but whether that works in practice is a matter of current research. Then comes a caveat Valsorda leaves out, even though he cites the TR in support: for applications with high or long-term protection needs, or for long-lived systems, the BSI still considers 256-bit keys advisable. It gives the same advice for message authentication codes (MACs).

The U.S. National Security Agency (NSA) requires AES-256 for all classification levels in its Commercial National Security Algorithm Suite 2.0 (CNSA 2.0), but it doesn't cite Grover as the reason. Its FAQ says symmetric algorithms are secure "provided the key size is sufficiently large" and that the CNSA 2.0 symmetric algorithms are essentially the same as in the previous suite. Valsorda reads the requirement as the choice of a single, generously sized level. By accepting AES-256 at the 256-bit level, he argues, CNSA 2.0 also concedes that Grover doesn't halve the security of AES.

Same Math, Different Advice

Bernstein and Lange draw a different conclusion from the same math. If qubit operations become small and fast enough, they write, Grover would threaten systems aiming for 2¹²⁸ security, such as 128-bit AES keys. Their advice: "We recommend simply switching to 256-bit AES keys: the extra costs are rarely noticeable." According to the AES standard FIPS 197, AES-256 runs 14 rounds instead of 10.

Bernstein also has a non-quantum argument against AES-128. In a 2015 blog post, he worked through attacks on many targets at once. Attack 2⁴⁰ keys that all encrypt the same known plaintext, and the first key falls after about 2⁸⁸ guesses, roughly 1,000 after 2⁹⁸. "NIST is foolishly continuing to recommend AES-128 keys," he wrote. Valsorda accepts such multi-target attacks as an exception that may call for extra margin, depending on how nonces are used. TLS with AES-128, he notes, meets the 128-bit level with large multi-target margins thanks to its nonce design.

Against switching just in case, Valsorda points to the work it ties up. In TLS, key establishment has little to do with cipher suites, and mixing necessary with unnecessary changes pulls people away from the urgent work.

My take: the two sides don't disagree about the math. They disagree about the cost of change. In a new protocol or data format, AES-256 costs next to nothing, and the BSI recommends it for data that needs long-term protection anyway. In existing systems, moving off AES-128 buys no security against quantum computers and competes for the same people as the migration away from RSA and ECC.

Assessment

AES-128 remains approved: NIST and the BSI both recommend AES-128 for new systems. Grover's square root shrinks to a small factor under parallelization and error correction.

AES-256 is a precaution, not a fix: The BSI advises 256 bits for long-term protection needs, Bernstein and Lange advise it across the board on cost grounds. CNSA 2.0 requires AES-256 at every level but doesn't base that on Grover.

Collisions are a separate case: Where the birthday bound applies, security in bits really is halved, even classically. The TR recommends only hash functions with at least 256-bit output and, with quantum collision algorithms in mind, advises 384 bits where collision resistance is needed long-term.

"Quantum-safe thanks to AES-256" isn't an argument: AES is only as safe as the exchange of its key. If key establishment runs over RSA or ECDH, a CRQC decrypts the traffic no matter how long the AES key is.

Recommendations

For Developers

  • Leave AES-128-GCM in existing configurations alone and put the effort into hybrid key establishment first, such as X25519MLKEM768 in TLS 1.3.
  • Make AES-256 the default in new protocols and data formats for data with a long protection period, as TR-02102-1 advises.
  • In your own protocols, check whether many keys encrypt the same known plaintext under predictable nonces. If they do, adopt the TLS 1.3 nonce design or use 256-bit keys.
  • Where collision resistance matters long-term, such as signatures on long-lived documents, use hash functions with at least 384-bit output, such as SHA-384.
  • Record AES with its key length in your cryptographic inventory and classify it as not quantum-vulnerable. The signed CBOM of Beyond Shor at /cbom shows what such an inventory looks like.

For CISOs, Information Security Officers and Consultants

  • Classify symmetric algorithms with keys of 128 bits or more as not quantum-vulnerable in migration plans and put staff on key establishment and signatures, starting with data that must stay confidential beyond 2031.
  • Don't accept vendor claims like "quantum-safe thanks to AES-256" until the key establishment scheme is named and is itself quantum-safe.
  • Write AES-256 into the requirements for new procurements of long-lived systems with high protection needs, without launching a replacement program for existing AES-128 deployments.
  • Where deliveries fall under CNSA 2.0, treat AES-256 as a compliance requirement and don't count it as a finding against AES-128 in risk assessments.

Conclusion: The Clock Is Ticking for RSA and ECC, Not AES

For Shor, estimates fall with every new paper. For RSA-2048, the qubit count dropped to a twentieth within six years. For Grover, a better oracle can only shave bits off the edges, because much of the square root is lost to parallelization no matter how good the circuit is. What would change the picture is a quantum attack on AES that does better than generic search, and neither NIST nor the BSI names one. I expect both to hold their line: AES-128 stays approved, and AES-256 stays the advice for long protection periods. Anyone planning the years until 2030 should spend them on key establishment and signatures.