HMAC (Hash-based Message Authentication Code, RFC 2104) is a construction that combines a cryptographic hash function with a secret key to produce a keyed digest. It provides integrity and authenticity, only key holders can produce valid digests, and is the standard building block for keyed identifier hashing and webhook signature verification.
HMAC's construction matters because it is not simply hashing the key with the message. The nested inner and outer hashing is what makes it resistant to length-extension, which naive concatenation schemes built on Merkle-Damgard hashes are not.
For webhook verification the practical requirements are ordinary and easy to get wrong: compare digests in constant time, and compute over the exact bytes received rather than a re-serialised copy.
For identifier hashing, HMAC is the standard construction because it is well understood, widely implemented and fast, and because its security argument does not depend on the input having entropy. That last property is what makes it the right tool for a phone number, where the input space is small enough that keyspace enumeration defeats an unkeyed digest outright.
For webhook verification the failure modes are boringly consistent across implementations. Comparing digests with an ordinary string comparison leaks timing; verifying a re-serialised copy of the payload rather than the exact bytes received means a signature that was valid on the wire fails, or worse, that a signature is checked against something other than what will be processed.
Replay is the part signature verification does not address on its own. A valid signed request stays valid, so the receiver needs a timestamp inside the signed material and a window it will accept, plus a record of recently seen identifiers. Without that, capturing one legitimate delivery is enough to repeat it, and any endpoint with side effects needs to be able to recognise a delivery it has already processed.
Verifying the exact bytes received, in constant time, against a signed timestamp inside an accepted window covers the three failures that recur.
It is the construction that makes a pepper usable as a key rather than as a prefix.
Related terms
PasskeyBridge verifies identity signals like these inside the request, with zero PII stored. See how the platform works or test the live API.