Hash-based Message Authentication Code - Design Principles

Design Principles

The design of the HMAC specification was motivated by the existence of attacks on more trivial mechanisms for combining a key with a hash function. For example, one might assume the same security that HMAC provides could be achieved with MAC = H(keymessage). However, this method suffers from a serious flaw: with most hash functions, it is easy to append data to the message without knowing the key and obtain another valid MAC ("length-extension attack"). The alternative, appending the key using MAC = H(messagekey), suffers from the problem that an attacker who can find a collision in the (unkeyed) hash function has a collision in the MAC (as two messages m1 and m2 yielding the same hash will provide the same start condition to the hash function before the appended key is hashed, hence the final hash will be the same). Using MAC = H(keymessagekey) is better, however various security papers have suggested vulnerabilities with this approach, even when two different keys are used.

No known extensions attacks have been found against the current HMAC specification which is defined as H(key1H(key2message)) because the outer application of the hash function masks the intermediate result of the internal hash. The values of ipad and opad are not critical to the security of the algorithm, but were defined in such a way to have a large Hamming distance from each other and so the inner and outer keys will have fewer bits in common. The security reduction of HMAC does require them to be different in at least one bit though.

Read more about this topic:  Hash-based Message Authentication Code

Famous quotes containing the words design and/or principles:

    Joe ... you remember I said you wouldn’t be cheated?... Nobody is really. Eventually all things work out. There’s a design in everything.
    Sidney Buchman (1902–1975)

    It is a life-and-death conflict between all those grand, universal, man-respecting principles which we call by the comprehensive term democracy, and all those partial, person-respecting, class-favoring elements which we group together under that silver-slippered word aristocracy. If this war does not mean that, it means nothing.
    Antoinette Brown Blackwell (1825–1921)