HMAC Generator
Generate HMAC signatures — authenticate messages with a secret key.
How to use HMAC Generator
- Enter the message and the secret key.
- Choose the hash algorithm — HMAC-SHA256 is the standard.
- Generate the signature — reproducible from the same message+key.
- Verify by recomputing: match the sender's HMAC using constant-time comparison; keep the secret server-side only.
What is HMAC Generator?
An HMAC generator produces a Hash-based Message Authentication Code — a hash computed with a secret key, so it proves both that a message wasn't altered and that it came from someone who knows the key. HMAC-SHA256(message, secret) is the ubiquitous form: same message + same key = same signature; change either and it changes.
The key is what separates HMAC from a plain hash. Anyone can compute SHA-256 of a message; only holders of the shared secret can compute the correct HMAC — which is exactly why it authenticates. It answers "did this come from who I think, unchanged?" — the question plain hashes can't.
About the HMAC Generator
Enter your message and secret key, pick the hash (SHA-256 is standard), and generate the HMAC signature.
Where HMAC runs the internet's plumbing: webhook verification — Stripe, GitHub, Shopify and countless services sign webhook payloads with HMAC using a secret only you and they know; your endpoint recomputes the HMAC and compares, rejecting forged or tampered calls (the canonical use — verify every webhook this way); API request signing — AWS Signature, many API auth schemes HMAC the request so servers confirm it came from a real key-holder and wasn't modified in transit; token integrity — the signature in JWTs (HS256) is HMAC-SHA256; and secure cookies and CSRF tokens — HMAC prevents client-side tampering.
Two essentials: the secret must stay secret (leaking it lets anyone forge signatures — treat it like a password, server-side only), and verification should use constant-time comparison (comparing signatures with normal string-equals leaks timing information attackers can exploit — libraries provide safe compare functions). This generator is for testing and learning; production uses your language's crypto library. See our JWT Decoder for the token side and SHA-256 for the underlying hash.