← Cryptography

🔏 HMAC

Compute an HMAC with any hash.

How it works

HMAC(K, m) = H((K′ ⊕ opad) ‖ H((K′ ⊕ ipad) ‖ m)), where K′ is the key padded to the hash’s block size (or hashed first if longer). Anyone with the key can create or check the MAC, so it proves integrity and authenticity between parties who share the key — not who signed it.