Hmac generator

Computes a hash-based message authentication code (HMAC) using a secret key and your favorite hashing function.

About Hmac generator

Computes an HMAC, a hash of a message mixed with a secret key, using MD5, SHA-1, SHA-2 (224, 256, 384, 512), SHA-3 or RIPEMD-160. An HMAC proves that a message was produced by someone who knows the key and was not altered on the way.

When you would use it

How to use it

  1. Enter the message in the plain text field and the shared secret in the secret key field.
  2. Choose the hashing function; SHA256 is the usual one.
  3. Choose the output encoding (hex, base64, base64url or binary) and copy the HMAC.

Things worth knowing

Frequently asked questions

What is the difference between HMAC and a plain hash?
A plain hash can be computed by anyone, so it only detects accidental changes. An HMAC needs the secret key, so it also proves who produced the message and stops an attacker from forging a matching value.
Why does my HMAC not match the one the service sent?
Typical causes are a different output encoding (hex versus base64), a key that should have been decoded first, the wrong hash function, or a body that was changed by a framework before you signed it.

All the tools