Headlines about quantum computers breaking encryption sometimes lump every algorithm together. The truth differs sharply by family. Public-key algorithms such as RSA and elliptic curves fall completely to Shor's algorithm.[2] Symmetric ciphers such as AES and hash functions such as SHA-256 face a much milder threat from a different algorithm, due to Lov Grover.
For a security architect this is good news. The fix for the symmetric side is mostly a matter of choosing 256-bit keys and confirming that you have done so everywhere.
Unstructured search
Suppose a vault has a million identical-looking doors and a prize behind exactly one. You have no clue which. All you can do is open them and look. On average you will open half a million before finding the prize, and in the worst case all of them. Computer scientists call this unstructured search. With N items, a classical search needs on the order of N tries.
Breaking a symmetric cipher by brute force is exactly this problem. If you hold a known plaintext and its ciphertext, you try every key until the encryption matches. A 128-bit key has 2128 possibilities. Nothing about the cipher's design gives a shortcut, and that absence of structure is what the designers aim for.
Brute force against short keys is a historical fact. In 1998 the Electronic Frontier Foundation's Deep Crack machine recovered a 56-bit DES key in 56 hours.[5] Triple DES and then AES were the answer, with longer keys that put exhaustive search out of reach.
How Grover's algorithm amplifies the right answer
Grover's 1996 algorithm finds the marked item in about √N steps instead of N.[1] It does not try the items one by one. It works on a superposition of all of them at once and repeatedly nudges probability towards the right one. Each nudge has two parts.
- The oracle. A reversible circuit checks whether a candidate is the answer and, if it is, flips the sign of that candidate's amplitude. For a cipher, the oracle encrypts the known plaintext under the candidate key and compares the result with the known ciphertext. A sign flip is invisible if you measure straight away, but it marks the right answer.
- The diffusion step. This operation reflects every amplitude about the average amplitude. Because the marked item is now below the average (it has a negative sign), the reflection pushes it well above the average, and the others sink slightly.
One oracle call and one diffusion step make up an iteration. Each iteration raises the amplitude of the right answer a little. After about (π/4)√N iterations the right answer holds nearly all the probability, and measuring the register reveals it. Keep going past that point and the probability falls again, so the number of iterations has to be about right.
Interference is doing the work, as in Shor's algorithm. The speed-up is real and also provably limited: for completely unstructured search, √N is the best any quantum algorithm can do.
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.
What a square root buys, and what it does not
Going from N to √N is a huge saving for small N, and for cryptographic key sizes it simply halves the exponent. A cipher with 128 bits of strength drops to 64 bits of quantum work. That sounds dangerous, but two practical facts blunt it.
The iterations are sequential
Each Grover iteration depends on the result of the one before. You cannot hand iterations to different machines and combine the results. The only way to use P machines is to give each one a slice of the key space, N/P keys, which takes √(N/P) iterations each. The time falls by a factor of only √P compared with one machine. A thousand machines cut the time by about thirty. A million machines cut it by a thousand.
Each iteration is a whole cipher evaluation
The oracle has to run the entire cipher as a reversible quantum circuit, and the machine must protect that circuit with error correction. A single iteration therefore takes far longer than one cipher operation on a conventional chip.
Because of this, many cryptographers argue that AES-128 remains adequate for the foreseeable future. NIST's post-quantum security categories 1, 3 and 5 are themselves defined by the cost of AES key search.[8] Still, 256-bit keys cost very little extra, and removing the argument is cheaper than having it.
Common misunderstandings
Several myths circulate about Grover's algorithm. Correcting them helps in discussions with colleagues and auditors.
- "Quantum computers halve every key." They halve the exponent of the work for symmetric keys. They do not touch RSA and elliptic curve keys in the same way, because those fall to Shor's algorithm, which is a far stronger attack.
- "Doubling the key length is a big cost." Moving from AES-128 to AES-256 adds about 40 per cent more rounds in the cipher (14 instead of 10), which modern processors absorb easily thanks to hardware AES instructions. Expect small differences in throughput in most workloads.
- "Grover breaks passwords." The speed-up applies to the search, so a weak password stays weak whatever the key length. A human-chosen passphrase usually has far less than 128 bits of entropy, so it is the passphrase that limits security.
- "A quantum computer can run Grover on a known, structured weakness." Grover is the generic method. If a cipher has a structural flaw, ordinary cryptanalysis is usually the better tool, and quantum versions of such attacks are active research topics without practical consequences for AES.
Passwords and passphrases deserve one more remark. When a key is derived from a passphrase, the derivation function's deliberate slowness helps against classical and quantum guessing alike, since each guess must run the function. The better defence remains a long, random secret managed by a key management system.
AES-128, AES-192, AES-256 and 3DES
| Cipher | Key bits | Classical brute force | Grover iterations (approx.) | Verdict |
|---|---|---|---|---|
| AES-128 | 128 | 2^128 | 2^64 | Weakened. Adequate for now by most analyses, but 256-bit is the safe choice for long-lived data. |
| AES-192 | 192 | 2^192 | 2^96 | Comfortable margin. |
| AES-256 | 256 | 2^256 | 2^128 | Comfortable. This is the CNSA 2.0 choice.[3] |
| 3DES (three-key) | 168 (112 effective) | about 2^112 | about 2^56, from 112 effective bits | Disallowed for encryption by NIST after 2023, whatever quantum computers do.[4] |
Triple DES deserves a separate note. Its effective strength was already about 112 bits against classical attacks, it uses a small 64-bit block, and NIST has disallowed three-key Triple DES for encryption after 2023.[4] Mainframes and older payment systems still use it in places. Replace it for classical reasons first. The quantum argument only adds to it.
Symmetric modes also matter. AES in GCM or CBC mode behaves the same way against Grover, since the attack targets the key. What changes is the margin, so the guidance is simply to use 256-bit keys.
Where symmetric keys hide in a bank
Symmetric keys appear in more places than most inventories record. Database and storage encryption, tokenisation vaults, card data protection, mainframe datasets, message authentication on payment links, backup encryption and the data keys inside cloud key management services all use them. Many of these are already AES-256 by default, and some older ones are 128-bit or 3DES. A scan of configuration and code will tell you which, and it takes far less effort than finding every public-key use. The more serious risk for symmetric keys is how they are distributed, because key transport that relies on RSA or ECDH brings the Shor exposure back in through the side door, as described in Harvest now, decrypt later.
Hash functions: preimages and collisions
A cryptographic hash must resist two kinds of attack, and Grover treats them differently.
- Preimage attacks. Given a hash output, find an input that produces it. This is unstructured search over 2n inputs for an n-bit hash, so Grover reduces it from 2n to about 2n/2. SHA-256 would give about 128 bits of quantum preimage strength, with the same sequential-iteration cost as for AES.
- Collision attacks. Find any two inputs with the same hash. Classically the birthday bound already limits this to about 2n/2 work. A quantum collision algorithm exists, but it needs an exponential amount of quantum memory, and analyses of its real cost find that it is no better than classical attacks when memory is priced in. In practice collision resistance is not meaningfully helped.
Hash weakness today comes from cryptanalysis, not quantum algorithms. The first SHA-1 collision was published in 2017,[6] and NIST announced in December 2022 that SHA-1 should be phased out by 31 December 2030.[7] The SHA-2 and SHA-3 families have no comparable breaks.
HMAC, key derivation and MACs
A message authentication code such as HMAC combines a secret key with a hash. Attacking it means guessing the key, which is a Grover-style search, or finding a collision-style flaw in the hash, which does not apply to HMAC in the same way. With a key of at least 128 bits the classical security is fine, and the quantum margin follows the same square-root rule as AES. Using HMAC-SHA-256 with a 256-bit key is the conservative choice. The same reasoning applies to key derivation functions such as HKDF, which use HMAC internally.
What NIST and CNSA 2.0 recommend
The NSA's CNSA 2.0 suite, published in September 2022, specifies AES-256 for symmetric encryption and SHA-384 or SHA-512 for hashing in national security systems.[3] NIST's post-quantum standards deal with public-key algorithms and leave AES and SHA-2 in place. NIST defines its security categories 1, 3 and 5 by the cost of exhaustive key search against AES-128, AES-192 and AES-256.[8]
Large enterprises can read the combined message as follows: keep AES, move to 256-bit keys where you can, use SHA-384 or SHA-512 for long-lived integrity, and spend your migration effort on public-key cryptography, where the threat is absolute.
Summary table
| Family | Quantum algorithm | Effect | Action |
|---|---|---|---|
| RSA, finite-field DH and DSA | Shor | Broken | Replace with ML-KEM, ML-DSA, SLH-DSA |
| ECDH, ECDSA, EdDSA | Shor | Broken | Replace with ML-KEM, ML-DSA, SLH-DSA |
| AES-128 | Grover | Effective strength about 64 bits of sequential quantum work | Prefer AES-256, especially for long-lived data |
| AES-256 | Grover | Effective strength about 128 bits | Keep |
| 3DES | Grover (and classical weakness) | Already disallowed by NIST for encryption after 2023 | Remove |
| SHA-256 preimages, HMAC | Grover | Halved exponent | Use SHA-384 or SHA-512 and 256-bit keys for long-term needs |
| Hash collisions | Quantum collision algorithms | No meaningful practical help | No change from classical guidance |
What to do now
- Run
qsc scanto list the symmetric algorithms and key sizes in code, configuration and infrastructure, and look for AES-128, 3DES, DES, RC4, SHA-1 and MD5 findings. - Switch default AES key sizes to 256 bits in new designs, key management service settings and data-at-rest policies, where the platform allows it.
- Remove 3DES from payment, mainframe and file-transfer paths first. This is a classical-security fix and a compliance one.
- Use SHA-384 or SHA-512 where signatures or integrity must last for decades.
- Keep most of your effort for public-key migration, which is where the urgent work lies. See the readiness tracker for what your platforms support.
Related reading: How Shor's algorithm breaks RSA shows the contrast with a full break, How today's cryptography works covers symmetric and public-key basics, and Harvest now, decrypt later explains why recorded data matters.