February 1997 | H. Krawczyk, M. Bellare, R. Canetti
HMAC is a mechanism for message authentication using cryptographic hash functions. It can be used with any iterative cryptographic hash function, such as MD5 or SHA-1, in combination with a secret shared key. The cryptographic strength of HMAC depends on the properties of the underlying hash function. HMAC is designed to use available hash functions without modification, preserve their performance, handle keys simply, and allow easy replacement of the hash function if needed. It is defined using a cryptographic hash function H and a secret key K. The process involves two steps: first, hashing the key with the inner pad (ipad), then hashing the result with the outer pad (opad). Keys longer than the block length of the hash function are first hashed using H. Keys should be chosen at random and periodically refreshed. HMAC's security relies on the cryptographic properties of the hash function, including resistance to collision finding and the message authentication property of the compression function. The strongest known attack against HMAC is based on the birthday attack, which is impractical for reasonable hash functions. HMAC is secure as long as the underlying hash function is secure. The output of HMAC can be truncated, but it should be at least half the length of the hash output. The document provides sample code for HMAC-MD5 and test vectors. HMAC is widely used and has been shown to be secure, although MD5 has recently been found vulnerable to collision attacks. HMAC is recommended for use with SHA-1, which is considered cryptographically stronger. The document also references various cryptographic references and provides authors' addresses.HMAC is a mechanism for message authentication using cryptographic hash functions. It can be used with any iterative cryptographic hash function, such as MD5 or SHA-1, in combination with a secret shared key. The cryptographic strength of HMAC depends on the properties of the underlying hash function. HMAC is designed to use available hash functions without modification, preserve their performance, handle keys simply, and allow easy replacement of the hash function if needed. It is defined using a cryptographic hash function H and a secret key K. The process involves two steps: first, hashing the key with the inner pad (ipad), then hashing the result with the outer pad (opad). Keys longer than the block length of the hash function are first hashed using H. Keys should be chosen at random and periodically refreshed. HMAC's security relies on the cryptographic properties of the hash function, including resistance to collision finding and the message authentication property of the compression function. The strongest known attack against HMAC is based on the birthday attack, which is impractical for reasonable hash functions. HMAC is secure as long as the underlying hash function is secure. The output of HMAC can be truncated, but it should be at least half the length of the hash output. The document provides sample code for HMAC-MD5 and test vectors. HMAC is widely used and has been shown to be secure, although MD5 has recently been found vulnerable to collision attacks. HMAC is recommended for use with SHA-1, which is considered cryptographically stronger. The document also references various cryptographic references and provides authors' addresses.