A large enough quantum computer would break RSA, Diffie-Hellman and elliptic curves, but not AES-256. Against symmetric ciphers, hashes and passwords, the best known quantum attack is Grover's algorithm or one of its variants, and Grover breaks nothing: it only makes brute force faster. On paper, a 256-bit key is left with the equivalent of 128 bits, which are still out of reach.
Here we explain what it does, why it achieves far less than that figure suggests and what the “Post-quantum” badge in the algorithm picker means.
What Grover's algorithm is
Lov Grover, of Bell Labs, published it in 1996. It solves a very general problem: finding what you are looking for among N possibilities with no clue as to where it is. An ordinary computer has to try them one by one, and on average it hits the answer halfway through. A quantum computer running Grover finds it in about √N steps.
In numbers: among a million possible keys, an ordinary computer tries half a million on average, while Grover needs about 800 steps. Among the 2128 keys of AES-128, the count goes from about 2127 tries to about 264.
There is no better shortcut. In 1997, Charles Bennett, Ethan Bernstein, Gilles Brassard and Umesh Vazirani proved that no quantum computer can search blindly in substantially fewer than √N steps, and Christof Zalka later proved that Grover is exactly optimal. The question is not whether a faster Grover will come along, but what it costs to run the one that already exists.
Nor does Grover find any weakness in the cipher: it is still brute force, with a quadratic advantage. Hence the usual rule of thumb: a k-bit key offers about k/2 bits against Grover. AES-128 would be left with about 64 and AES-256 with about 128.
Why that figure exaggerates
The rule counts steps, not what each step costs, and Grover takes them under very poor conditions:
- Each step is several complete runs of AES inside the quantum computer. Grover does not try keys one at a time: in each step it computes AES on all the keys at once, as a quantum circuit. Markus Grassl and his co-authors calculated in 2016 that attacking AES-128 this way takes about 3,000 logical qubits (qubits already protected against errors) and on the order of 286 T gates, the most expensive quantum operations, with a depth of about 281 steps that have to be taken one after another. Later studies, such as that of Jaques, Naehrig, Roetteler and Virdia (2020), have made the circuit cheaper (thousands of times fewer gates than NIST had estimated, at the cost of more qubits), but they do not change the conclusion.
- It does not parallelize well. A thousand quantum computers working at once do not finish a thousand times sooner, only about 32 times sooner (the square root of a thousand). Zalka proved that the work cannot be split better than by dividing the keys among independent machines, and that gives exactly this gain.
- Error correction is expensive. Physical qubits make errors all the time, and each logical qubit is built from hundreds of them that watch over one another. That multiplies the size of the machine and lengthens each step.
This is the calculation the calculator above does, and the sum is our own, not a published study's: even if a machine took a million logical steps per second, a very optimistic assumption, the sequential part of the attack on AES-128 would last almost 90 billion years, more than six times the age of the universe. To finish it in ten years, it would have to be split among tens of quintillions of quantum computers, each with thousands of logical qubits.
Under those same assumptions, up to about 76 bits the ordinary computer finishes before the quantum one: try it with the 56 bits of DES. Grover's advantage only shows with long keys, just when both searches already take more than a thousand years.