0Pricing
Cryptology Academy · Lesson

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

  1. MAC Concepts & Length-Extension Attacks
  2. HMAC Construction & Security Proof
  3. HMAC in APIs: Request Signing
  4. CMAC & Poly1305: Block-Cipher MACs
← Back to Cryptology Academy