HMAC Generator
Generate HMAC-SHA256, HMAC-SHA384, and HMAC-SHA512 message authentication codes. Verify request integrity, sign webhooks, or validate API payloads.
What is HMAC used for?
HMAC (Hash-based Message Authentication Code) proves that a message came from someone who knows the secret key and hasn't been tampered with. Common uses: webhook signature verification (GitHub, Stripe, Shopify all use HMAC-SHA256), API request signing, and JWT HS256/HS512 signatures under the hood. Unlike a plain hash, HMAC requires the secret — an attacker can't forge it without knowing the key.
A secret key (any length) and the message to authenticate
Key padded/hashed to block size (64 bytes for SHA-256, 128 bytes for SHA-512)
H((K XOR ipad) || message) — first hash pass with inner padding (0x36 repeated)
H((K XOR opad) || inner_hash) — second hash pass with outer padding (0x5C repeated)
The final HMAC — hex or Base64 encoded — proves message integrity and key possession
Spec: RFC 2104 (HMAC), FIPS 198-1, combined with FIPS 180-4 (SHA-2)