Week 9 | what is broken, what is weakened, how to read a resource estimate, and why the migration has to start before the machine exists | reading: Gidney (2025), abstract, introduction and conclusion; FIPS 203, §1–3
Lectures 11–16 built the two quantum attacks on cryptography: Grover's quadratic speedup for search, and Shor's polynomial-time algorithms for factoring and discrete logarithms. This lecture, the end of Block II, asks what they mean in practice. By the end you should be able to sort a cryptographic primitive into broken, weakened or believed resistant and say why; list the quantities a resource estimate depends on and read one critically; explain harvest-now-decrypt-later with Mosca's inequality; and describe the NIST post-quantum standards and the migration timeline at the level a policy memo needs.
The classification follows from the mathematics of the previous lectures, not from the name of the algorithm. Ask: what problem does the primitive's security rest on, and what is the best quantum algorithm for that problem?
| underlying problem | examples | best quantum attack | status |
|---|---|---|---|
| factoring | RSA-3072, RSA-4096 | Shor (Lecture 15): polynomial | broken once a large enough machine exists, whatever the key size |
| discrete log in \(\mathbb Z_p^*\) | finite-field Diffie–Hellman, DSA | Shor (Lecture 16): polynomial | broken |
| elliptic-curve discrete log | X25519, ECDSA P-384, Ed25519 | Shor (Lecture 16): polynomial, and the cheapest target | broken |
| key search in a block cipher | AES-192, ChaCha20 | Grover (Lectures 11–12): about \(2^{k/2}\) idealised | weakened: halve the bits, then add back the real cost of Grover |
| hash preimages and collisions | SHA-384, SHA3-256 | Grover for preimages; essentially no gain for collisions | weakened (preimages) or unaffected |
| lattice problems (Module-LWE, Module-SIS) | ML-DSA (FIPS 204) | none better than generic (Lecture 16, Section 5) | believed resistant |
| hash-function security only | SLH-DSA (FIPS 205), LMS, XMSS | Grover-type, generic | believed resistant with suitable parameters |
| decoding random linear codes | HQC, Classic McEliece | none better than generic | believed resistant |
Tick every primitive that Shor's algorithm breaks (given a large enough machine).
Two lessons. First, for public-key schemes based on factoring or discrete logs, no key size helps: Shor's cost grows polynomially, so doubling the key multiplies the attack cost by about 8, not by \(2^{\text{something}}\). The only fix is a different problem. Second, for symmetric schemes the fix is a parameter change: 256-bit keys and 384-bit hashes restore comfortable margins (Lecture 12). HW9 asks you to classify six specific primitives in the same way.
A bank responds to the quantum threat by moving from RSA-2048 to RSA-8192. Against a large enough quantum computer running Shor's algorithm, the new keys are .
A cryptographically relevant quantum computer (CRQC) is a quantum computer able to break a cryptographic primitive in practical use, such as RSA-2048 or a 256-bit elliptic curve, in a time short enough to matter (hours to months). Q-Day is the (unknown) date on which the first one exists.
Today's machines are nowhere near this: the largest gate-based devices have on the order of a hundred to a thousand physical qubits, with two-qubit error rates around \(10^{-3}\) at best, and they run small error-corrected experiments, not long computations. Every claim about Q-Day therefore rests on a resource estimate: a calculation of what a hypothetical machine would need. An estimate has two layers, and you should always know which numbers come from which.
Logical layer (the algorithm, as in Lectures 15–16):
Physical layer (the machine and its error-correcting code, Lectures 21–23):
Tick the quantities that belong to the physical layer of a resource estimate.
For the surface code, a useful rule of thumb (Lecture 23 makes it precise) is that each logical qubit costs about \(2d^2\) physical qubits and fails per cycle with probability about \(0.1\,(p/p_{\text{th}})^{(d+1)/2}\), with threshold \(p_{\text{th}}\approx1\%\). The distance must make the whole computation succeed: logical qubits times time steps times the per-step error must stay below, say, 10%. The second code box in Section 8 runs these numbers for 1,000 logical qubits and \(10^9\) steps: at \(p=10^{-3}\) it needs \(d=23\) and about a million physical qubits for the data alone, and at \(p=10^{-4}\) only about a quarter as many. This is not any paper's method, but it shows the structure: the physical error rate enters exponentially, through the distance.
Use the rule of thumb with distance \(d=17\) and \(p=10^{-3}\). How many physical qubits does each logical qubit cost, and what is \(\log_{10}\) of its failure probability per cycle?
The most cited estimate for RSA-2048 is Gidney and Ekerå (2019, published in Quantum in 2021). Its assumptions are stated up front, which is the first thing to look for:
Under these assumptions they estimated 20 million noisy qubits for 8 hours, down from the hundreds of millions to a billion of earlier estimates. Most of the savings came from the arithmetic: windowed modular exponentiation (looking up several exponent bits at once), oblivious carry runways (cutting long carry chains into short parallel pieces), coset representations of modular integers, and a careful layout of the surface code on the chip.
In 2025 Gidney revised the estimate, keeping the same hardware assumptions: fewer than one million noisy qubits, in less than a week. HW9 asks you to read the paper's abstract, introduction and conclusion and identify the three main ideas behind the reduction. Two observations need no reading:
A hypothetical design needs 4 million physical qubits running for 2 days. What is its space–time volume, in units of \(10^8\) qubit-hours?
Since 2025 new estimates arrive every few months, many as preprints with press releases. Two from 2026 illustrate the questions to ask.
Pinnacle claims RSA-2048 with fewer than 100,000 physical qubits, against Gidney's one million. Which of the five questions exposes the main difference in assumptions?
Applying these questions does not mean dismissing the claims. The trend in the figure is real and steep: four orders of magnitude in fifteen years, mostly from better algorithms and codes rather than better hardware. A sensible reading is that the hardware bar is coming down to meet the hardware, and that the date is uncertain.
An adversary can record encrypted traffic today and store it until a CRQC exists. Key exchange is the vulnerable step: once the shared key is recovered from a recorded RSA or Diffie–Hellman handshake, every message protected by that key can be read, years later. Michele Mosca turned this into a simple inequality.
Let \(x\) be the number of years the data must remain secret, \(y\) the number of years needed to migrate the system to quantum-safe cryptography, and \(z\) the number of years until a CRQC exists. If
$$x+y\gt z,$$then some data encrypted by the system will still need protecting when it can be decrypted.
Proof. Until the migration ends, \(y\) years from now, the system keeps producing quantum-vulnerable ciphertexts. The last of them must stay secret until \(y+x\) years from now. If \(z\lt x+y\), it is exposed for the remaining \(x+y-z\) years (assuming it was recorded).
A company's trade secrets must stay confidential for \(x=12\) years, and its migration will take \(y=5\) years. If a CRQC appears in \(z=10\) years, for how many years is the last vulnerable ciphertext exposed?
A court system encrypts sealed records (juvenile records, protected witnesses) that must stay confidential for 25 years. Migrating its document systems, vendors and archives will take 7 years. For which Q-Day dates is it already late?
\(x+y=25+7=32\). If a CRQC exists within 32 years, that is, by about 2058, then records sealed near the end of the migration can be decrypted while they are still supposed to be sealed, provided someone recorded them in transit or copied the encrypted archive. Every estimate in the figure of Section 3 makes 32 years look long. The inequality does not require knowing \(z\); it only requires believing \(z\) might be less than 32.
Harvest-now-decrypt-later affects confidentiality, so key exchange and encryption must move first. Signatures are different: a forged signature is only useful while the signature is being checked, so a signature scheme can be replaced up to Q-Day itself. The exceptions are long-lived trust anchors, such as firmware signing keys and root certificates burned into devices that will still be in service when a CRQC exists; those need early attention too.
NIST ran an open competition from 2016. Its first three post-quantum standards were published in August 2024, and further selections followed.
| standard | role | based on | status |
|---|---|---|---|
| ML-KEM (FIPS 203, from CRYSTALS-Kyber) | key encapsulation (key exchange) | Module-LWE lattices | final, August 2024 |
| ML-DSA (FIPS 204, from CRYSTALS-Dilithium) | signatures | Module-LWE / SIS lattices | final, August 2024 |
| SLH-DSA (FIPS 205, from SPHINCS+) | signatures (conservative backup) | hash functions only | final, August 2024 |
| FN-DSA (FIPS 206, from Falcon) | signatures (compact) | NTRU lattices | in preparation |
| HQC | key encapsulation (backup to ML-KEM) | codes | selected March 2025; standard to follow |
The timeline. NIST's draft transition plan, IR 8547 (initial public draft, November 2024), proposes that quantum-vulnerable public-key algorithms such as RSA, finite-field and elliptic-curve Diffie–Hellman, ECDSA and EdDSA be deprecated after 2030 and disallowed after 2035 in U.S. federal systems. NIST's SP 800-227 (final, September 2025) gives recommendations for using key-encapsulation mechanisms. Deployment is already widespread for key exchange: major browsers and content-delivery networks negotiate a hybrid of X25519 and ML-KEM-768 by default, and messaging apps such as Signal and iMessage have added post-quantum key agreement.
Hybrid key exchange runs a classical and a post-quantum key exchange together and derives the session key from both, so an attacker must break both. It protects against a quantum computer (through ML-KEM) and against an unexpected classical break of the young post-quantum scheme (through X25519). Crypto-agility means building systems so that algorithms can be replaced by configuration rather than by redesign; the main lesson of the RSA-to-ECC and SHA-1 transitions was how long it takes without it.
A session key derived from a hybrid X25519 + ML-KEM exchange can be recovered by an attacker who breaks .
Post-quantum cryptography (PQC) is ordinary software that runs on today's computers and is believed hard for quantum ones. Quantum key distribution (QKD, Lecture 20) uses quantum states to distribute keys with security based on physics, but needs special hardware and dedicated links, and does not provide signatures. Government agencies in the U.S., U.K. and France currently recommend PQC as the primary migration path. Lecture 20 explains what QKD does guarantee.
ML-KEM's security rests on learning with errors (LWE; Regev, 2005). Pick a prime modulus \(q\), a secret vector \(s\in\mathbb Z_q^n\), and publish many noisy linear equations:
$$b=As+e\pmod q ,$$where \(A\) is a public random \(m\times n\) matrix and \(e\) is a vector of small random errors. Without \(e\) this is linear algebra: Gaussian elimination recovers \(s\) in polynomial time. With \(e\), elimination mixes the errors together until they fill the whole range mod \(q\), and the best known algorithms, classical or quantum, take time exponential in \(n\). ML-KEM uses a structured version (Module-LWE, with \(n=256\)-coefficient polynomials and \(q=3329\)) for efficiency.
A one-dimensional LWE toy: \(q=7\), a secret \(s\in\mathbb Z_7\), and one equation \(b=3s+e\pmod 7\) with \(b=5\) and an unknown error \(e\in\{-1,0,1\}\). How many values of \(s\) are consistent with this equation?
The first code box in Section 8 takes \(q=17\), \(n=3\), six equations, and errors in \(\{-1,0,1\}\). What happens?
Without errors, elimination returns the secret \((5,11,2)\) and the three extra equations are consistent. With errors, elimination returns \((3,15,3)\), which is wrong, and the extra equations become inconsistent. Brute force over all \(17^3=4913\) candidates, keeping the one whose residuals are smallest, does recover \((5,11,2)\). That works here because \(17^3\) is tiny; for ML-KEM the analogous search space has well over \(2^{100}\) elements, and the clever (lattice-reduction) attacks are still exponential.
The connection to Lecture 16: Regev's reduction relates such lattice problems to the dihedral hidden subgroup problem, where Fourier sampling has not led to an efficient algorithm. LWE is the problem behind most of the new standards because it has survived that line of attack, has worst-case to average-case reductions, and is fast in practice.
import itertools import numpy as np q, n, m = 17, 3, 6 # modulus, secret length, number of equations rng = np.random.default_rng(17) A = rng.integers(0, q, size=(m, n)) # public random matrix s = np.array([5, 11, 2]) # the secret e = rng.integers(-1, 2, size=m) # small errors in {-1, 0, 1} b = (A @ s + e) % q # public: (A, b) def solve_mod(A, b, q): """Gauss-Jordan elimination mod a prime q; returns (solution from the first n pivots, leftover residuals)""" M = np.concatenate([A % q, (b % q)[:, None]], axis=1).astype(int); rows, cols = M.shape; r = 0 for c in range(cols - 1): piv = next((i for i in range(r, rows) if M[i, c] % q), None) if piv is None: continue M[[r, piv]] = M[[piv, r]]; M[r] = M[r] * pow(int(M[r, c]), -1, q) % q for i in range(rows): if i != r and M[i, c]: M[i] = (M[i] - M[i, c] * M[r]) % q r += 1 return M[:cols - 1, -1], M[cols - 1:, -1] sol, res = solve_mod(A, (A @ s) % q, q) print("without errors: elimination gives", sol, " leftover equations consistent:", not res.any()) sol, res = solve_mod(A, b, q) print("with errors: elimination gives", sol, " leftover residuals:", res, "(inconsistent)") centered = lambda v: (v + q // 2) % q - q // 2 # represent residues in -8..8 best = min(itertools.product(range(q), repeat=n), key=lambda c: np.abs(centered(A @ np.array(c) - b)).sum()) print(f"brute force over all {q**n} candidates finds", list(best), "(the secret is", s.tolist(), ")")
without errors: elimination gives [ 5 11 2] leftover equations consistent: True with errors: elimination gives [ 3 15 3] leftover residuals: [5 9 4] (inconsistent) brute force over all 4913 candidates finds [5, 11, 2] (the secret is [5, 11, 2] )
Example 17.2. The errors are tiny (\(\pm1\)) but elimination amplifies them: each row operation multiplies and adds them, and after a few steps they are as large as the numbers themselves.
# A back-of-envelope surface-code budget (illustrative rule of thumb; real estimates are far more detailed) def distance(p, p_th=1e-2, target=1e-13): """smallest odd d with logical error per qubit per step 0.1 (p/p_th)^((d+1)/2) <= target""" d = 3 while 0.1 * (p / p_th) ** ((d + 1) / 2) > target * (1 + 1e-9): d += 2 return d L, D = 1000, 1e9 # logical qubits, logical time steps target = 0.1 / (L * D) # allow a 10% chance that anything fails for p in (1e-3, 3e-4, 1e-4): d = distance(p, target=target) print(f"physical error {p:.0e}: distance {d:2d}, about {2 * d * d:5d} physical per logical, " f"{2 * d * d * L / 1e6:.2f} million physical qubits (data only, no magic-state factories)")
physical error 1e-03: distance 23, about 1058 physical per logical, 1.06 million physical qubits (data only, no magic-state factories) physical error 3e-04: distance 15, about 450 physical per logical, 0.45 million physical qubits (data only, no magic-state factories) physical error 1e-04: distance 11, about 242 physical per logical, 0.24 million physical qubits (data only, no magic-state factories)
Lowering the physical error rate tenfold, from \(10^{-3}\) to \(10^{-4}\), halves the distance and cuts the footprint by more than a factor of four. That is why hardware papers report error rates as prominently as qubit counts. The same rule is what the footprint widget in Section 2 uses.
End of Block II. Next: density matrices and quantum channels, the language of noise, which every resource estimate above depends on. HW9 covers Lectures 17–18.
all computed numbers and figures in these notes come from python (verify_L17.py); estimates are quoted from the cited papers; standards status as of October 2026