HMAC Construction & Security Proof
Walk through the ipad/opad construction and its security properties.
Welcome
HMAC is the standard keyed MAC construction. Its double-hash design prevents length-extension attacks and has a formal security proof reducing HMAC security to the underlying hash function.
HMAC Construction
HMAC(K, M) = H((K' ⊕ opad) || H((K' ⊕ ipad) || M))
Where:
- K' = K zero-padded to block size B (or H(K) if |K|>B)
- ipad = 0x36 repeated B times
- opad = 0x5C repeated B times
All lessons in this course
- MAC Concepts & Length-Extension Attacks
- HMAC Construction & Security Proof
- HMAC in APIs: Request Signing
- CMAC & Poly1305: Block-Cipher MACs