44

I was reading a paper related to post quantum cryptography. It says that RSA, ECC and ElGamal encryption schemes would be obsolete with the advent of quantum computers. But the hash functions can still be secure. I don't understand how one can unilaterally claim this security when hash functions themselves are not based on any hard problems. (I do have the knowledge of Merkel-Damgård and Keccak construction).

Are there hash functions considered secure just because nobody has come up with a quantum algorithm to solve it? Or are there any reduction to any well known hard problem? It there is please explain the reduction.

Mike Edward Moras
  • 18,161
  • 12
  • 87
  • 240

4 Answers4

54

It is a bit dubious to claim that hash functions "are not based on any hard problem": inverting a standard hash function, or finding a collision, is itself a very hard problem.

The point of a reduction is to gather the cryptanalytic effort on a smaller number of hypothesis. The fact that RSA-OAEP is CCA secure under the RSA assumption is not a proof that it is secure, simply an indication that to study its security, it suffices to study the security of the RSA problem. As many other cryptographic primitives can be reduced to the RSA assumption, it saves a considerable cryptanalytic effort.

Now, such reductions usually rely on some nice algebraic properties of mathematical hypothesis, exploiting group structure, self-randomizability, and so on. These properties are common in asymmetric cryptography, because such additional structure is already necessary in the primitives it involves. But in symmetric crypto, on the other hand, such structure is typically avoided. A consequence of that is that you need way smaller primitives (in terms of bit size) and much less computationally expensive operations to achieve a (conjectured) given security level, but you loose the possibility of reducing many symmetric primitives to a small number of hypothesis.

Still, for the most widely deployed block ciphers and hash functions, the cryptanalytic effort that has been invested on studying their security easily matches the effort invested on "generic hypothesis" such as the discrete logarithm or the factorisation, because they are widely used in practice. Therefore, there is no reason to believe that, due to the lack of reductions, inverting SHA256 should be any easier than breaking RSA. In fact, because RSA has so much structure, most experts would probably be way more surprised by an attack that inverts SHA256 than by an attack that breaks RSA. Therefore, the fact that ElGamal and the kind enjoy "reductions" does absolutely not make them more secure - it only establishes links between hardness of different primitives.

That being said, quantum computers are not magical. We cannot say anything for sure about what we can or what we cannot break with them - for all we know, it could be that $P=NP$, and that all of cryptography can be broken using a classical computer. But our current knowledge gives us some intuition on the additional power they give over classical computers. And this intuition can be summed up as follow: it seems to give some additional power, but to still fall short on solving very hard problems (say, NP-complete problems) in reasonable time.

Some problems with a special structure (factorization, discrete log) typically fall in the category of problem for which quantum computers would give a very strong speedup, because they can be reduced to the task of finding the period of some function, which seems hard to do with a classical computer, but not with a quantum one. For unstructured problems, quantum computers seem to provide some non-trivial quadratic speedup, via the use of the Grover algorithm. But a quadratic speedup does not give an attack, it simply indicates that the size of the keys should be increased by a factor two to compensate for this speedup.

Hash functions are rather unstructured, so we currently do not see how to get more than a quadratic speedup over a classical computer to attack one. Therefore, we currently conjecture that a hash function with 256 bits of classical security would still have 128 bits of quantum security. For collision resistance, quantum computers provide an even less impressive speedup: the birthday attack gives a $O(\sqrt{n})$ attack, and its quantum version seems only to make this attack $O(n^{1/3})$. (Note years later: see the comments below by SEJPM and Squeamish Ossifrage for why in reality, this $O(n^{1/3})$ cost is a wild underestimate of the true cost of quantum collision search, and why it does actually not even beat the classical $\sqrt{n}$-time birthday paradox attack).

Geoffroy Couteau
  • 21,719
  • 2
  • 55
  • 78
11

Common hash functions are based on combinatorial problems. Very coarsely, (future) quantum computers are claimed to be able to solve combinatorial problems with effort (at worst) $O(2^{k/2})$ for $k$ unknown bits, versus $O(2^k)$ for classical computers. Thus quantum computer do not imply the doom of security of all hashes; at worse, it implies doubling some security parameters.

I trust SHA-512 against all kinds of computers more than I trust SHA-256 against classical ones.


Update, 2024 (6.5 years later): Consensus is still that for combinatorial problems including SHA2 and SHA3, an hypothetical Cryptographically Relevant Quantum Computer would reduce security from $k$-bit to no less than $k/2$-bit, e.g. for preimage-resistance of a $k$-bit hash. And there's no conjectured method approaching this when it comes to collision-resistance of a $2k$-bit hash.

fgrieu
  • 149,326
  • 13
  • 324
  • 622
0

security of some symmetric structures can be prove against quantum adversary as well. For example you can see 'Post-quantum security of the CBC, CFB, OFB, CTR, and XTS modes of operation'. SHA3 is based on sponge function which its security has been proved under some assumption against quantum adversary. you can find some of them by just a quick search.

ali khosravi
  • 171
  • 6
-15

A hash is just a symmetric cipher run in a loop, encrypting the input using a key also from the same input, and often with extra stuff sprinkled in as you go (e.g. prime remainders in SHA-2).

I'm no expert, but whether or not any hash is quantum-resistant boils down entirely to whether or not the symmetric cipher chosen for the hash is.

The SHA-2 cipher is secret (classified), so only the NSA (who invented SHA) know if it's quantum-resistant or not.