Hash-based Message Authentication Code
HMAC(K, m) = H((K' ⊕ opad) || H((K' ⊕ ipad) || m))
Shared between sender and receiver
Data to authenticate
Proves authenticity & integrity
Paste an HMAC to verify the message hasn't been tampered with:
Try changing the message slightly and see how the HMAC completely changes:
HMAC provides both integrity (message hasn't been modified) and authentication (message came from someone with the secret key). Unlike digital signatures, HMAC uses symmetric keys, making it faster and suitable for high-throughput applications.
HMAC is used in JWT tokens, API authentication, cookie signing, and secure protocols like TLS.