Cryptanalysis of HMAC/NMAC-Whirlpool

Jian Guo, Yu Sasaki, Lei Wang, Shuang WuLecture Notes in Computer Science 2013 · DOI · OpenAlex

Abstract

Message Authentication Codes (MACs) are essential for ensuring data integrity and authenticity. While the security of hash functions is often evaluated in public settings, their robustness within secret-key constructions like HMAC and NMAC is equally critical. This paper presents the first original key recovery attacks against HMAC and NMAC when instantiated with the Whirlpool hash function. By exploiting the AES-like structural properties of Whirlpool, the researchers developed universal forgery attacks for versions reduced to 6 rounds and a novel distinguishing attack for the full 10-round construction.

Introduction

Message Authentication Codes (MACs) such as HMAC and NMAC serve as the foundation for security in widely used protocols like TLS and IPsec. Whirlpool is an ISO-standardized hash function that utilizes an internal block cipher with an AES-like design. Traditionally, cryptanalysis of hash functions focuses on collision resistance in a "public" setting where all parameters are known. However, in a MAC setting, internal states are protected by secret keys, theoretically making them more resistant to attack. This research challenges the assumption that this secrecy provides an insurmountable barrier, specifically investigating how the structural properties of AES-like designs can be leveraged to recover secret keys or forge messages.

Methods

The researchers utilized a multi-stage cryptanalytic strategy to penetrate the secret-key environment of HMAC/NMAC-Whirlpool.

The structural layout of HMAC and NMAC using an internal block cipher E.

The attack methodology involves several sophisticated techniques:

  1. Structured Collisions: For the 5-round attack, the authors generate specific chosen messages to induce a "structured collision" on the internal state. Although the state remains secret, these collisions can be detected through the MAC's output.
  2. Meet-in-the-Middle (MitM): Upon identifying a collision, a MitM approach is used to recover internal values. The authors adapted "splice-and-cut" techniques—originally intended for preimage attacks on public hash functions—to function within the constraints of a secret-key MAC.
  3. 3-Near-Collisions: To extend the analysis to 6 rounds, a "3-near-collision" requirement was introduced. This allows for more effective filtering of key candidates by matching values across multiple differential paths.
Differential cryptanalysis path for Whirlpool, illustrating state guesses and bit filtering.
  1. Padding Exploitation: For the full 10-round "distinguishing-H" attack, the authors observed that the final message block in the outer hash call of HMAC is always a constant padding block. This determinism allows the MAC to be distinguished from a truly random function with significantly fewer queries ($2^{256}$ instead of the expected $2^{512}$).

Key Insights

A primary takeaway is that the secrecy of internal states in a MAC does not guarantee security if the underlying primitive possesses strong structural properties, such as those found in AES-like block ciphers. Furthermore, while previous HMAC attacks often only recovered "equivalent keys" (values that allow for forgery without revealing the actual key), this research achieves original key recovery, successfully identifying the actual secret $K$. The authors also demonstrated that "rebound attacks" and "splice-and-cut" methods can be adapted to hidden-state settings by using message differentials to leak internal information.

Key Results

The following table summarizes the computational complexity of the developed attacks. Given that Whirlpool produces a 512-bit output, a theoretically perfect MAC would require $2^{512}$ operations to break.

Target Rounds Attack Mode Time Complexity
HMAC-Whirlpool 5 / 10 Universal Forgery $2^{402}$
HMAC-Whirlpool 5 / 10 Key Recovery $2^{448}$
HMAC-Whirlpool 6 / 10 Universal Forgery $2^{451}$
HMAC-Whirlpool 6 / 10 Key Recovery $2^{496}$
HMAC-Whirlpool 10 (Full) Distinguishing-H $2^{256}$

While these complexities remain extremely high, any attack that performs better than brute-force ($2^{512}$) is considered a significant cryptanalytic break.

Conclusion

Although the high complexity of these attacks means they do not pose an immediate threat to current implementations of 10-round Whirlpool, they represent a substantial reduction in the security margin. Future work may involve extending these techniques to related-key settings or applying them to other AES-like hash functions such as Grøstl. This research provides a vital roadmap for evaluating the long-term security of MAC constructions based on structured hash primitives.

Summary updated

BibTeX
@inproceedings{guo2013cryptanalysis,
  author = {Jian Guo and Yu Sasaki and Lei Wang and Shuang Wu},
  title = {{Cryptanalysis of HMAC/NMAC-Whirlpool}},
  booktitle = {Lecture Notes in Computer Science},
  year = {2013},
  doi = {10.1007/978-3-642-42045-0\_2},
}
Figure