A hash-based message authentication code (HMAC) is a type of message authentication code built from a cryptographic hash function, such as SHA-256, and a secret key shared by the sender and the receiver. The construction, published in RFC 2104 in 1997, hashes the key and the message together in two nested passes. The result is a short tag that changes completely if either the message or the key changes, so a receiver holding the same key can recompute the tag and confirm that the message is authentic and intact.
HMAC is widely used in payments technology. Payment providers sign webhook notifications with an HMAC so that merchants can reject forged calls, and many APIs use it to sign requests as part of API authentication. It also underlies one-time password algorithms. Unlike a digital signature, an HMAC uses a symmetric key, so it cannot prove to a third party which of the two key holders created it.
Ref 1300000387