Summary

  • RFC 2104, February 1997, defines message authentication as a wrapper rather than a rewrite: "HMAC is defined in such a way that the underlying hash function H can be used with no modification to its code".
  • It names the property it actually needs, and says so out loud: MD5's collision trouble "and other currently known weaknesses of MD5 do not compromise the use of MD5 within HMAC".
  • The same paragraph doubles as a maintenance schedule: implementers "need to be aware of possible cryptanalytic developments regarding any of these cryptographic hash functions, and the eventual need to replace the underlying hash function".

Wrapping instead of modifying

Most standards that want flexibility build it into the algorithm, then spend a decade arguing about which variant wins. HMAC did the opposite. It left the hash alone — untouched, unimproved, unmodified — and wrapped it: two calls, two different padded keys, one XOR at the end. The hash is a black box. The construction is the contract.

That is why the same design shipped against MD5, SHA-1 and, later, the SHA-2 family without touching a line of hash code and without settling the argument about which hash was best. The construction was fixed. The ingredient was swappable. In 1997 that looked like modesty. When the collisions arrived, it looked like foresight.

What it needs from the hash, and what it does not

A digital signature needs collision resistance, because an attacker who can produce two messages with the same digest can swap one for the other and let the signature do the lying. A keyed authentication tag needs less: it needs the function to look unpredictable to anyone who does not hold the key. That is a weaker demand — and, crucially, a demand you can write down.

HMAC was analysed in exactly those terms. That is why practical MD5 collisions wrecked signature schemes built on MD5 and left HMAC-MD5 quietly doing its job. Same hash. Different question asked of it. Different fate.

The value of a narrow assumption

A protocol that assumes less about its building blocks can survive their failure. HMAC is the cleanest case in the standards record, and the narrowing was deliberate — not luck, not hindsight, not a happy accident of the 1990s. The thinner the demand, the longer the life.

The corollary matters as much. Naming the weak property is what lets you tell, later, whether you still have it. RFC 2104 names it, and then does something rarer: it warns, in the same document, that the ingredient will eventually have to be replaced. A specification that predicts its own maintenance schedule is a specification that expects to be maintained.

Key management does not come free

The implementation notes spend their ink on keys, not on mathematics: generate them at random, refresh them periodically, and accept that a longer key buys nothing when the randomness behind it is thin. Length is not entropy. It never was.

No construction rescues a reused key, and no hash rescues a key that leaked. Keeping the algorithm and the hygiene in separate arguments is what lets you fix one without pretending the other was ever the problem.

Where this pattern failed elsewhere

Constructions that quietly leaned on a stronger property of their hash aged badly the moment that property broke — not because the cryptographers were lazy, but because the security argument had never been written in terms of the property that actually mattered. When the assumption failed, nobody could say whether the construction had failed with it. So it had.

The difference is not cleverness. It is a sentence in the specification naming the exact property you need, so that on the day the ingredient weakens you can answer the only question that matters — are we affected? — without convening a committee.

The lesson about narrow dependencies

Ask for the least your design needs, then say so where everyone can read it. A construction that assumes collision resistance inherits every collision attack ever found. One that assumes a pseudorandom function inherits only the failures of that single assumption — a much smaller estate to defend.

Narrow dependencies are a form of redundancy. They let one part of the system break without taking the rest with it, which is the only kind of robustness that ever arrives on schedule.