Is the security of the HMAC based on SHA-1 affected by the collisions attacks on SHA-1?
相关问题
- C# Rijndael decryption returns extra question mark
- java 11 HttpClient leads to endless SSL loop even
- AesManaged and RijndaelManaged
- Is It Ever Recommended To Use The ECB Cipher Mode?
- How to implement IDEA?
相关文章
- Working with hmacsha256 in windows store app
- Decrypting EnvelopedCms with non-default Algorithm
- How to use @EqualsAndHashCode With Include - Lombo
- How to apply padding for Base64
- How to switch from AES-256 to AES-128?
- Encrypting with PHP; decrypting with CryptoJS
- Java SHA-1 hash an unsigned BYTE
- iOS symmetric key encryption / decryption equivale
The strongest attack known against HMAC is based on the frequency of collisions for the hash function H ("birthday attack") [PV,BCK2], and is totally impractical for minimally reasonable hash functions.
As an example, if we consider a hash function like MD5 where the output length equals L=16 bytes (128 bits) the attacker needs to acquire the correct message authentication tags computed (with the same secret key K!) on about 264 known plaintexts. This would require the processing of at least 264 blocks under H, an impossible task in any realistic scenario (for a block length of 64 bytes this would take 250,000 years in a continuous 1Gbps link, and without changing the secret key K during all this time). This attack could become realistic only if serious flaws in the collision behavior of the function H are discovered (e.g. collisions found after 2**30 messages). Such a discovery would determine the immediate replacement of the function H (the effects of such failure would be far more severe for the traditional uses of H in the context of digital signatures, public key certificates, etc.).
Note: this attack needs to be strongly contrasted with regular collision attacks on cryptographic hash functions where no secret key is involved and where 264 off-line parallelizable (!) operations suffice to find collisions. The latter attack is approaching feasibility [VW] ***while the birthday attack on HMAC is totally impractical. (In the above examples, if one uses a hash function with, say, 160 bit of output then 264 should be replaced by 280.)*
A correct implementation of the above construction, the choice of random (or cryptographically pseudorandom) keys, a secure key exchange mechanism, frequent key refreshments, and good secrecy protection of keys are all essential ingredients for the security of the integrity verification mechanism provided by HMAC.
The security implications of HMAC are described in detail in the security section of the RFC. In a nutshell, a very strong attack indeed is required before the security of the HMAC is threatened; the existing collision attacks on SHA-1 certainly don't constitute such. HMAC is specifically designed to make attacks difficult, and ordinary collision attacks won't generally suffice:
I recommend reading the whole section; it goes into more detail about exactly what attacks would suffice to break an HMAC, and just how much effort would be required.
See this question for a discussion on the same theme. In a nutshell: collision attacks do not directly harm HMAC. But the existence of collision attacks implies that the compression function on which the hash function is built is not a "random oracle", and this voids the HMAC security proof.