Managed key services (KMS, Key Vault, Cloud KMS)
RSA and EC keys for signing and wrapping are quantum-vulnerable. Post-quantum key types are arriving provider by provider.
|shor⟩ · N = p × q
RSA is safe because multiplying two primes is easy and splitting the product back apart is not. Elliptic curves rest on a similar one-way problem. Shor's algorithm turns both into a search for a repeating pattern, and finding repeating patterns is exactly what quantum interference is good at. Try it below with numbers small enough to watch.
|one-way⟩
Anyone can check that 61 × 53 = 3233. Going backwards from 3233 takes trial and error. For the 617-digit numbers in a 2,048-bit RSA key, the best classical method would run for longer than the universe has existed.
| Number | Size | Factored | Effort |
|---|---|---|---|
| RSA-129 | 426 bits | 1994 | a volunteer internet effort, months |
| RSA-768 | 768 bits | 2009 | almost 2,000 single-core years |
| RSA-250 | 829 bits | 2020 | about 2,700 core-years |
| RSA-2048 | 2,048 bits | never | ~10¹¹ × RSA-250 classically · under a week on a large quantum computer (estimate) |
Every public RSA key contains a number like this. Its two prime factors are the private key.
|lab⟩
1 · classical check
gcd(2, 55) = 1, so a shares no factor with N. Now the hard part: find the period of aˣ mod N.
2 · the repeating pattern
The values of ax mod N repeat every r = 20 steps; each colour band is one period. A classical computer has to walk the sequence to see it repeat. For a 2,048-bit N the period can have hundreds of digits, so that walk never ends.
3 · quantum interference
The quantum computer puts all Q = 4,096 values of x into superposition, computes ax mod N for all of them at once, then applies the quantum Fourier transform. Everything cancels except sharp peaks at multiples of Q / r. One measurement lands on a peak.
4 · from period to factors
Measure first. The outcome y is close to a multiple of Q / r; a continued-fraction expansion of y / Q recovers r.
N = ? × ?
Why the last step works: if r is even, ar − 1 = (ar/2 − 1)(ar/2 + 1) is a multiple of N, so N shares a factor with each bracket. Euclid's gcd algorithm pulls it out instantly. Unlucky choices of a (odd r, or ar/2 ≡ −1) just mean trying another a.
|curves⟩
ECDH, ECDSA and Ed25519 rely on the discrete logarithm problem on a curve: given points P and k·P, find k. A variant of Shor's algorithm finds k the same way it finds a period.
Elliptic-curve keys are short, so the machine needed is no larger than for RSA. One published estimate puts P-256 at about 2,330 error-corrected qubits (Roetteler et al., 2017). Most TLS key exchange today is elliptic-curve.
Read: elliptic curves under Shor →RSA hard problem
N = p × q → find p, q
Diffie–Hellman hard problem
gk mod p → find k
Elliptic-curve hard problem
k·P → find k
Shor's algorithm
Solves all three in polynomial time.
|grover⟩
classical brute force · 2^127 guesses on average
5.4 × 10²¹ years
Grover · about 2^64 steps
584 years
verdict
Fine for most data today. For secrets that must last decades, and for CNSA 2.0, use AES-256.
Both columns assume a generous billion guesses per second. Real error-corrected Grover steps are far slower, and splitting the search across machines only helps by the square root of their number.
|impact⟩
Anything recorded today can be decrypted on Q-day: old TLS sessions, VPN traffic, PGP mail, RSA-wrapped backups. The damage reaches back in time, which is why key exchange is fixed first.
A forged signature only works after Q-day: fake software updates, fake certificates, fake payment instructions. But roots of trust, firmware keys and long-lived certificates take years to replace, so they must start now too.
| Algorithm | Where you find it | Attack | What happens | Replace with |
|---|---|---|---|---|
| RSA encryption | TLS 1.2 RSA key exchange, PGP, S/MIME, RSA-wrapped data keys | Shor | Recorded data is decrypted | ML-KEM, hybrid first |
| ECDH / DH | TLS 1.3, SSH, IPsec and VPNs, messaging | Shor | Recorded sessions are decrypted | X25519MLKEM768, then ML-KEM |
| RSA / ECDSA signatures | Certificates, JWT, SAML, code signing, documents | Shor | Forgery after Q-day | ML-DSA, SLH-DSA |
| Ed25519 | SSH keys, Git and package signing | Shor | Forgery after Q-day | ML-DSA |
| Firmware roots | Secure boot, HSM firmware, devices in the field | Shor | Malicious updates accepted | LMS / XMSS, ML-DSA |
| AES-128, 3DES | Bulk encryption, payment systems | Grover | Security margin roughly halved | AES-256 |
| SHA-256 | Hashing, HMAC, integrity | Grover | Still strong; CNSA 2.0 asks for SHA-384 | SHA-384 / SHA-512 |
|code⟩
- KeyPairGenerator.getInstance("RSA").initialize(2048);+ KEM kem = KEM.getInstance("ML-KEM"); // ML-KEM-768 by default
- priv, _ := ecdh.P256().GenerateKey(rand.Reader)+ dk, _ := mlkem.GenerateKey768()
- ssl_ecdh_curve X25519:prime256v1;+ ssl_ecdh_curve X25519MLKEM768:X25519:prime256v1;
- KexAlgorithms curve25519-sha256+ KexAlgorithms mlkem768x25519-sha256,curve25519-sha256
- jwt.sign(claims, key, { algorithm: 'RS256' })+ // ML-DSA for JOSE is still a draft: track the advisory
- key_spec = "ECC_NIST_P256"+ key_spec = "ML_DSA_65"
|cloud⟩
RSA and EC keys for signing and wrapping are quantum-vulnerable. Post-quantum key types are arriving provider by provider.
Data keys under AES-256-GCM are already fine. The risk is any RSA key used to wrap them.
TLS policies decide the key exchange. Many already offer hybrid ML-KEM policies to switch on.
Public web certificates are still RSA or ECDSA everywhere; post-quantum web PKI is not standardised yet.
Istio, Envoy and Linkerd follow the TLS library underneath. Hybrid key exchange arrives with the upgrade.
RSA, ECDSA and Ed25519 host and user keys. OpenSSH 10 negotiates post-quantum key exchange by default.
Firmware decides what algorithms exist. Ask the vendor for a dated post-quantum roadmap.
Most cloud APIs sign requests with HMAC-SHA256, which quantum computers do not break.
|threat⟩ · 4 articles in the library
From factoring to period finding, the quantum Fourier transform and continued fractions, with a worked example and the latest resource estimates.
Why Diffie–Hellman, ECDH, ECDSA and EdDSA fall to the same algorithm, and what the resource estimates say about curves.
Why AES and SHA-2 are weakened rather than broken, why the speed-up is hard to use, and why 256-bit keys settle it.
Why recorded data is already at risk, Mosca's inequality worked through for real data types, and what Q-day uncertainty means for planning.