Glossary

HMAC explained.

HMAC (Hash-based Message Authentication Code) is a way to sign data with a shared secret key so the receiver can confirm both who sent the message and that it has not been changed.

Definition

How HMAC works

A plain hash like SHA-256 turns any input into a fixed-length fingerprint, but anyone can compute it, so on its own it proves nothing about who made it. HMAC adds a secret key into the hashing so that only someone who holds that key can produce a valid result.

The sender mixes the message with the shared secret in a specific, standardized way and runs it through the hash function, producing a short code, then sends that code alongside the message. The receiver, who holds the same secret, repeats the calculation over the message it got and compares the two codes with a constant-time check. A match means the message is authentic (only a key holder could have made the code) and intact (any edit to the message changes the code). Because it needs only a shared secret and a hash function, HMAC is fast and everywhere.

For a form backend it's the engine behind a webhook signature: FormWire computes an HMAC of each webhook body with your secret so your endpoint can prove the request really came from FormWire.

The moving parts

What HMAC combines.

A shared secret

Both sides hold the same key and nobody else does, so producing a valid code is proof of holding it.

A hash function

A one-way function like SHA-256 turns the keyed message into a short fingerprint that can't be reversed or forged without the key.

A signature to verify

The receiver recomputes the code and compares, the exact mechanism behind a webhook signature.

Related questions

Want to see it working?

Read the docs
Ready in a minute

Verify every signed request.

Free tier forever. No credit card required.