February 1997 | H. Krawczyk, M. Bellare, R. Canetti
This document, RFC 2104, introduces HMAC (HMAC: Keyed-Hashing for Message Authentication), a mechanism for message authentication using cryptographic hash functions. HMAC can be applied to any iterative cryptographic hash function, such as MD5 or SHA-1, and requires a secret key for calculation and verification. The document outlines the construction and security analysis of HMAC, emphasizing its independence from the specific hash function used and its robustness against collision attacks. Key points include:
1. **Introduction**: HMAC is designed to provide integrity checking for information transmitted over or stored in unreliable media. It is based on cryptographic hash functions and uses a secret key for authentication.
2. **Definition of HMAC**: HMAC involves a cryptographic hash function \( H \) and a secret key \( K \). The authentication process involves two steps: XORing the key with fixed strings \( \text{ipad} \) and \( \text{opad} \), and then applying \( H \) to the resulting values.
3. **Keys**: The key for HMAC can be of any length, but shorter keys are discouraged due to reduced security strength. Keys should be chosen randomly and periodically refreshed.
4. **Implementation Note**: HMAC can be implemented without modifying the underlying hash function, but performance improvements can be achieved by precomputing intermediate results.
5. **Truncated Output**: Truncating the output of HMAC can reduce the amount of information available to an attacker, but the recommended output length is at least half the hash output length or 80 bits.
6. **Security**: The security of HMAC depends on the cryptographic properties of the underlying hash function, such as resistance to collision finding. The strongest known attack is impractical for reasonably secure hash functions.
The document also provides a detailed explanation of the HMAC construction, including sample code for MD5, and discusses the importance of secure key management and implementation practices.This document, RFC 2104, introduces HMAC (HMAC: Keyed-Hashing for Message Authentication), a mechanism for message authentication using cryptographic hash functions. HMAC can be applied to any iterative cryptographic hash function, such as MD5 or SHA-1, and requires a secret key for calculation and verification. The document outlines the construction and security analysis of HMAC, emphasizing its independence from the specific hash function used and its robustness against collision attacks. Key points include:
1. **Introduction**: HMAC is designed to provide integrity checking for information transmitted over or stored in unreliable media. It is based on cryptographic hash functions and uses a secret key for authentication.
2. **Definition of HMAC**: HMAC involves a cryptographic hash function \( H \) and a secret key \( K \). The authentication process involves two steps: XORing the key with fixed strings \( \text{ipad} \) and \( \text{opad} \), and then applying \( H \) to the resulting values.
3. **Keys**: The key for HMAC can be of any length, but shorter keys are discouraged due to reduced security strength. Keys should be chosen randomly and periodically refreshed.
4. **Implementation Note**: HMAC can be implemented without modifying the underlying hash function, but performance improvements can be achieved by precomputing intermediate results.
5. **Truncated Output**: Truncating the output of HMAC can reduce the amount of information available to an attacker, but the recommended output length is at least half the hash output length or 80 bits.
6. **Security**: The security of HMAC depends on the cryptographic properties of the underlying hash function, such as resistance to collision finding. The strongest known attack is impractical for reasonably secure hash functions.
The document also provides a detailed explanation of the HMAC construction, including sample code for MD5, and discusses the importance of secure key management and implementation practices.