Differential Cryptanalysis of KHF

David A. WagnerFSE 1998

Abstract: Bakhtiari et al. recently proposed a fast message authentication primitive called KHF. This paper shows that KHF is highly vulnerable to differential cryptanalysis: it can be broken with about 37 chosen message queries. This suggests that the KHF design should be reconsidered.

Introduction

In the mid-1990s, the cryptographic community sought high-performance, software-based Message Authentication Codes (MACs) to secure burgeoning network traffic. The KHF primitive, introduced in 1996, appeared to be a promising candidate. It was designed with a strong emphasis on the non-linearity of its Boolean functions—a traditional defense against linear cryptanalysis.

However, as David Wagner demonstrated in his 1998 analysis, theoretical non-linearity at the bit level does not guarantee holistic security. Wagner identified a massive oversight in the KHF architecture: while the functions were non-linear, they were applied bit-by-bit in parallel. This paper details how a total lack of bitwise diffusion allows for a devastating differential cryptanalysis attack, breaking KHF with as few as 37 chosen-message queries.

The Diffusion Trap

The fundamental weakness of KHF lies in its bitwise-parallel architecture. While the round functions ($f_i$) are non-linear, they operate on each bit position of a 32-bit word independently. In modern cryptographic design, "diffusion"—the property where a change in one input bit affects many output bits—is considered essential. KHF lacked this entirely across bit positions.

Wagner’s most striking insight was that "good" Boolean functions are insufficient if the overall structure is flawed. KHF achieved excellent non-linearity within a single bit position, but because it lacked diffusion across bit positions, an attacker could isolate and exploit individual bits. While bitwise parallel evaluation makes software implementation extremely fast, it creates a structural weakness if not paired with operations that mix the bits, such as rotations or additions.

Methodology: Differential Cryptanalysis

Wagner utilized differential cryptanalysis to exploit this lack of diffusion. This technique involves observing how specific differences in input messages propagate through the algorithm to affect the output.

Identifying Weak Rounds

By calculating the probability of collisions for different round functions, Wagner found that certain rounds were particularly susceptible. For instance, round $i \equiv 3 \pmod 5$ has a 75% probability of producing a zero difference (a collision) despite a single-bit change in the input. Across various rounds, the probability that a one-bit change in the message leaves the round output unchanged ranges from 37.5% to 75%.

Chaining Collisions

The attack involves introducing identical one-bit differences into two consecutive message words ($M_i$ and $M_{i+1}$). This strategy forces the internal states to "sync up" again, effectively canceling the difference before it can propagate to the final MAC output. If an attacker can find two messages ($M$ and $M'$) that result in the same internal state, they can forge a MAC for a longer message ($M || Y$) simply by requesting the MAC for ($M' || Y$). This "internal collision" bypasses the need to ever recover the secret key.

Results and Empirical Validation

The attack is remarkably efficient compared to the brute-force efforts usually required to break a MAC. Wagner's findings include:

  • Total Attack Complexity: KHF can be broken with approximately 37 chosen-message queries on average for internal state recovery.
  • MAC Forgery: A simpler version of the attack can achieve MAC forgery with approximately 72 queries, provided the message is at least 60 bytes long. Shorter messages can still be attacked, though they require a higher number of queries.
  • Empirical Confirmation: Wagner implemented the attack and confirmed that the theoretical 1/36 probability for the specific differential characteristic held true in practice.

Conclusion and Lessons for Design

The failure of KHF serves as a cautionary tale for cryptographic design. It demonstrates that optimizing for a single metric, such as non-linearity, can lead to fatal flaws if the overall architecture ignores basic principles like diffusion.

Wagner concluded that the vulnerabilities in KHF are so fundamental to its bitwise-parallel design that no simple patch exists. The paper recommends that the design be abandoned entirely in favor of primitives that prioritize bit-mixing. This research highlights that parallelism in cryptography is a double-edged sword: while it offers speed, it must be carefully managed to prevent attackers from isolating and conquering individual bits of the internal state.

Summary updated

Abstract

Bakhtiari et al recently proposed a fast message authentication primitive called KHF. This paper shows that KHF is highly vulnerable to differential cryptanalysis: it can be broken with about 37 chosen message queries. This suggests that the KHF design should be reconsidered.
BibTeX
@inproceedings{wagner1998differential,
  author = {David A. Wagner},
  title = {{Differential Cryptanalysis of KHF}},
  booktitle = {FSE},
  year = {1998},
  url = {https://openreview.net/forum?id=NY1weslWCg},
}

Loading related content...

Figure