Does Grover's algorithm really threaten symmetric cryptography?
Lov K. Grover's algorithm reduces the key search into $\mathcal{O}(\sqrt{2^n})$ instead of the $\mathcal{O}(2^n)$. What is generally not mentioned is the number of successive evaluations; it is $\mathcal{O}(\sqrt{2^n})$, too. What do we know about the successive calls? Almost nothing since nothing was built yet. We can only estimate it even with some good numbers like assuming that one can prepare-and-run the Gover machine in one nanosecond. Then for AES-128 (or any block cipher with 128-bit key), it will take $\approx 585$ years.
|
AES-128 |
AES-192 |
AES-256 |
complexity |
$2^{64}$ |
$2^{96}$ |
$2^{128}$ |
evaluations (circa) |
$2^{64}$ |
$2^{96}$ |
$2^{128}$ |
approx-time |
$\approx 583$ years |
$\approx 583\cdot 2^{32}$ years |
$\approx 583\cdot 2^{64}$ years |
Grover's algorithm also can be parallelized, the gain, however, is not quadratic speed up as one expected. For running $k$ machine one gets $\sqrt{k}$ speed ups. Therefore if one runs $10^6$ Grover's machine in parallel they can break AES-128 for less than one year. We cannot do more on the Grover's algorithm since, it is also proven that Grover's algorithm is asymptotically optimal, $\Omega(\sqrt{2^n})$
So as of current, it is not easy to call AES-128 is not quantum-safe. The practical problems that scientists and engineers are working on must be solved to break AES-128 in a meaningful time. In the end, we expect that it will be broken, actually, any block cipher with a 128-bit key is broken, and there is nothing specific to AES.
On the other hand, AES-128 has other major problems than Grover's algorithm; multi-target, or small block size for proper random IV guarantees for GCM.
Is AES-256 (or any block cipher with 256-bit key) a post-quantum secure cipher or not?
It is and it will be always secure. Therefore AES-256 is the golden standard in the industry with only 40% performance penalty when compared to AES-128. Always use AES-256 with a good mode of operation for your target security.
This is also the reason that we don't have a Post-Quantum call for new symmetric encryption algorithms from NITS PQC like for Cryptographic Hash functions.
That explains why we are using 256-bit keys to encrypt top secrets. But latest practical attack on AES shows brute-forcing AES-256 take $2^{100}$ operations.
This attack is a related-key attack and not practical in the sense of what is done to RC4 with related-key attack.
This is also misleading since the attack requires $2^{99.5}$-time and $2^{99.5}$-data complexity. Though the collective Bitcoin Miners can reach $\approx 2^{93}$ SHA-256d in a year, they don't store the data. This is the major problem of the attack. Since we cannot store this amount in memory, we have to consider the bottleneck of the data access, too.
As a practice matter, one selects the AES key either
- uniform randomly
- as a result of a key exchange like DHKE, then a cryptographic hash function is applied, or
- form a password with a password-based key derivation function like PBKDF2, Scrypt, and Argon2.
The attacker has no means to control the selected key. And, it will be very surprising that any of these can aid the related-key attacker. We can say this is not a key recovery attack.
As a conclusion: use AES-256 or ChaCha20 with a proper mode of operation to be safe from The Grover machine.