The Quantum Threat
A sufficiently large, fault-tolerant quantum computer would shatter the public-key cryptography that secures the internet. Understanding exactly what breaks — and what merely needs strengthening — is the foundation of any migration plan.
Two quantum algorithms, two very different impacts
The quantum threat to cryptography comes down to two famous algorithms with wildly different consequences.
Shor's algorithm — the existential threat
Shor's algorithm (1994) solves integer factorization and discrete logarithms in polynomial time on a quantum computer. Those two problems are the entire foundation of classical public-key cryptography. A large fault-tolerant quantum computer running Shor's algorithm would break:
- RSA — factoring large integers becomes tractable.
- Finite-field Diffie-Hellman — the discrete log problem falls.
- Elliptic-curve crypto (
ECDH,ECDSA, Curve25519) — the elliptic-curve discrete log falls too.
This is not a marginal weakening; it is a total collapse. Larger key sizes do not help, because Shor's runtime grows only polynomially. The only answer is to switch to algorithms based on different math — that is, post-quantum cryptography.
Grover's algorithm — a manageable nuisance
Grover's algorithm speeds up brute-force search, but only quadratically. Against an n-bit symmetric key, it reduces the effective search from 2^n to roughly 2^(n/2) operations — it halves the security level. This is real but generally manageable: in common engineering estimates, increasing symmetric key length offsets the quadratic speedup from Grover; the actual security margin still depends on the algorithm, implementation, and resource estimates.
What breaks, what survives
| Primitive | Quantum attack | Status | Action |
|---|---|---|---|
| RSA | Shor | Broken | Replace with PQC |
| Diffie-Hellman (FFDH) | Shor | Broken | Replace with PQC |
| ECDH / ECDSA | Shor | Broken | Replace with PQC |
| AES-128 | Grover | Strength is roughly halved under an idealized Grover model, so prefer AES-256 for long-term high security; real quantum resource costs, depth limits and limited parallelization affect this estimate. | Move to AES-256 |
| AES-256 | Grover | Safe (~128-bit) | Keep |
| SHA-256 | Grover | Preimage security is about 128-bit under an idealized Grover model; collision security needs separate analysis. | Use SHA-384/512 for long-term high-security margin. |
| SHA-384 / SHA-512 | Grover | Safe | Keep |
The headline: public-key crypto is doomed; symmetric crypto and hashes are fine with adequate sizes.
What is a CRQC?
The term that matters operationally is cryptographically relevant quantum computer (CRQC) — a machine large and reliable enough to run Shor's algorithm against real-world key sizes (e.g., factoring a 2048-bit RSA modulus or breaking a 256-bit elliptic curve). A CRQC is not just any quantum computer; it is one that crosses the threshold of practical cryptanalysis. No CRQC exists today, and credible estimates for when one might appear range from roughly a decade to several decades — with deep uncertainty in both directions.
The current hardware reality
It is essential to separate today's machines from the hypothetical CRQC.
NISQ machines
We live in the NISQ era — Noisy Intermediate-Scale Quantum. Current devices have tens to a few hundred physical qubits, but those qubits are noisy: they decohere quickly and accumulate errors that ruin long computations. NISQ machines cannot run Shor's algorithm at cryptographically relevant scales.
Logical versus physical qubits
Breaking RSA-2048 is estimated to require a few thousand logical qubits — qubits that behave perfectly. But logical qubits are built from many noisy physical qubits using quantum error correction, with overheads commonly cited at hundreds to thousands of physical qubits per logical qubit. The practical requirement is therefore on the order of hundreds of thousands to millions of physical qubits: early estimates put it near 20 million (Gidney–Ekerå, 2019), and a 2025 revision lowered it to under 1 million noisy qubits (Gidney, arXiv:2505.15917) — still far beyond today's hardware.
Error correction is the gating problem
The central engineering challenge is fault tolerance: error-correcting codes (such as surface codes) must suppress errors faster than they accumulate. Recent demonstrations of error correction at small scale are genuine progress, but a fault-tolerant CRQC remains a substantial leap away.
Harvest Now, Decrypt Later →
Why the absence of a CRQC is no comfort.
Security Levels →
NIST levels 1–5 and how to pick.
Standards & references
- NIST Post-Quantum Cryptography project — the program coordinating the quantum-safe transition.
- NIST IR 8547 — transition to post-quantum cryptography standards, including deprecation timelines.
- NSA CNSA 2.0 advisory — the Commercial National Security Algorithm Suite and its mandated quantum-safe algorithms.
- Resources — full standards register
量子威胁
一台足够大且容错的量子计算机将彻底击碎守护互联网的公钥密码。准确理解什么会被攻破、什么只需加固,是任何迁移计划的基石。
两种量子算法 两种截然不同的冲击
量子计算对密码学的威胁归结为两个著名算法,二者的后果却天差地别。
Shor 算法 生存级威胁
Shor 算法于 1994 年提出,能在量子计算机上以多项式时间求解整数分解与离散对数,而这两个问题正是经典公钥密码的全部根基。一台运行 Shor 算法的大型容错量子计算机将攻破:
- RSA——大整数分解变得可行。
- 有限域 Diffie-Hellman——离散对数问题被攻克。
- 椭圆曲线密码——
ECDH、ECDSA、Curve25519 等的椭圆曲线离散对数同样被攻克。
这并非小幅削弱,而是彻底崩塌;加大密钥长度也无济于事,因为 Shor 算法的运行时间仅随多项式增长。唯一出路是改用基于不同数学难题的算法,即 后量子密码。
Grover 算法 可控的麻烦
Grover 算法能加速暴力搜索,但仅是平方级。对 n 比特对称密钥,它把有效搜索从 2^n 降到约 2^(n/2) 次运算,即把安全强度减半。这一威胁真实存在但通常可控:在常见工程估算中,提高对称密钥长度可抵消 Grover 带来的平方级加速;实际安全裕度仍需结合算法、实现与资源估计判断。
什么被攻破 什么幸存
| 原语 | 量子攻击 | 状态 | 对策 |
|---|---|---|---|
| RSA | Shor | 已攻破 | 替换为 PQC |
| Diffie-Hellman FFDH | Shor | 已攻破 | 替换为 PQC |
| ECDH / ECDSA | Shor | 已攻破 | 替换为 PQC |
| AES-128 | Grover | 在理想 Grover 模型下安全强度约减半,因此长期高安全场景建议升至 AES-256;实际量子资源成本、深度限制与并行化效率会影响这一估计。 | 升至 AES-256 |
| AES-256 | Grover | 安全 约 128 比特 | 保留 |
| SHA-256 | Grover | 原像安全在理想 Grover 模型下约为 128 比特;碰撞安全需单独分析。 | 长期高安全裕度场景可采用 SHA-384/512。 |
| SHA-384 / SHA-512 | Grover | 安全 | 保留 |
核心结论:公钥密码注定崩塌,对称密码与哈希在足够长度下安然无恙。
什么是 CRQC
在工程层面真正重要的术语是密码相关量子计算机(CRQC),即一台足够大且足够可靠、能针对现实密钥长度运行 Shor 算法的机器,例如分解 2048 比特 RSA 模数或攻破 256 比特椭圆曲线。CRQC 并非随便一台量子计算机,而是跨过实用密码分析门槛的那一台。今天尚无 CRQC 存在;关于它何时出现,可信估计从约十年到数十年不等,且两个方向都存在巨大不确定性。
当前硬件现实
必须把今天的机器与假想中的 CRQC 区分开来。
NISQ 机器
我们身处 NISQ(含噪声中等规模量子)时代,当前设备拥有数十到数百个物理量子比特,但这些比特噪声很大,会快速退相干并累积错误,毁掉长时间计算。NISQ 机器无法在密码相关规模上运行 Shor 算法。
逻辑量子比特与物理量子比特
攻破 RSA-2048 估计需要数千个逻辑量子比特,即表现完美的比特;而逻辑量子比特要用许多含噪声的物理量子比特通过量子纠错构建,通常引用的开销是每个逻辑比特需要数百到数千个物理比特。因此实际需求量级在数十万到数百万个物理量子比特:早期估计约 2000 万个(Gidney–Ekerå,2019),而 2025 年的最新估计下修到不足 100 万个含噪声比特(Gidney,arXiv:2505.15917)——仍远超今天的硬件。
纠错是瓶颈
核心工程挑战是容错:纠错码(如表面码)必须以快于错误累积的速度抑制错误。近期小规模纠错演示是实打实的进展,但距离一台容错的 CRQC 仍有相当大的跨越。
标准与参考
- NIST 后量子密码项目 — 统筹量子安全迁移的计划。
- NIST IR 8547 — 向后量子密码标准过渡 含算法弃用时间线。
- NSA CNSA 2.0 咨询通告 — 商用国家安全算法套件及其强制采用的量子安全算法。
- 资源链接 — 完整标准登记册