Compute an HMAC from a message and a shared secret, and check whether it matches a signature you received (runs in your browser)
An HMAC is determined by three things together: the message, the hash function and the key. If any one of them differs from the sender, the value changes.
A hash is computed from the input alone, so anyone who knows the input can produce the same value. HMAC also uses a shared secret key, so only the sender and receiver who hold the key can produce the same value. That is what makes it usable for proving who produced a message, which is exactly how webhook signature verification works.
No. This tool uses only the browser built-in Web Crypto API (crypto.subtle) and everything is computed inside your browser. There is no request to a server and nothing is stored. Even so, avoid pasting production secrets into a browser on someone else machine or a shared terminal, regardless of how the tool is implemented.
There are three common causes. First, the message: use the raw received body, not a re-serialized JSON string. Second, how the key is read: reading a hex key as UTF-8 gives a different key. Third, the output encoding: the sender may send Base64 while you compare against hex. This tool shows both hex and Base64, and tells you which one matched.
No. The browser built-in Web Crypto API does not support MD5. The supported hashes are SHA-1, SHA-256, SHA-384 and SHA-512. HMAC-SHA-1 is not immediately broken by the known SHA-1 collisions because of how HMAC is constructed, but choose SHA-256 or stronger for new designs.
Yes. The first two samples are RFC 4231 test vectors. The first uses a key of 0x0b repeated 20 times with the message Hi There, giving HMAC-SHA-256 b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7. The second uses the key Jefe with the message what do ya want for nothing?, giving 5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843.