Overview
HMAC wraps a cryptographic hash with inner and outer keyed hashes to verify message integrity and authenticity.
Authenticates messages by combining a hash function with a shared secret key.
Compact metadata for implementation and discovery.
HMAC wraps a cryptographic hash with inner and outer keyed hashes to verify message integrity and authenticity.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n)
Average
O(n)
Worst
O(n)
Space
O(1)
HMAC = H((key xor opad) || H((key xor ipad) || message))Combines a secret key and hash function to authenticate a message.
Show a message passing through inner and outer keyed hash layers.
HMAC operates in O(n) time and O(1) space within the Message Authentication family. Key governing relation: HMAC = H((key xor opad) || H((key xor ipad) || message)). Often compared with SHA-256 and ChaCha20.
What each reference supports for this entry.
Good next jumps from the relationship graph, ranked for useful discovery.
Cryptography · Extended
SipHash is a keyed hash for hash-table protection rather than a general MAC construction.
Compare with thisCryptography · Foundation
HMAC can be instantiated with SHA-256 as its underlying hash.
Compare with thisCryptography · Core
HMAC-DRBG uses HMAC as its state update and output primitive.
Compare with thisCryptography · Core
PBKDF2 is commonly instantiated with HMAC as its pseudorandom function.
Compare with this