Sign a message, verify a signature
HMAC (RFC 2104) combines a shared secret key with a hash function to produce a signature for a message. Whoever receives the message runs the same calculation with the same key: if the two signatures match, the message came from someone who holds the key and has not changed by a single byte on the way. This is how services sign their webhooks and how many APIs authenticate their requests.
This HMAC generator covers the three steps involved: create the key, compute the signature of a message, and check a signature you received against the one it computes. Everything runs on your browser's Web Crypto API, and the page is not allowed to make a single network request: the key and the message stay here.
How to use it
- The key. A fresh key is generated when the page opens: 32 bytes drawn by
crypto.getRandomValues, written in hexadecimal, so 64 characters. To debug an existing webhook, replace it with the secret the service gave you. - The message. Paste the exact request body, without reformatting it. The signature appears right away in three forms.
- The check. Paste the signature you received, in hex or Base64, with or without a prefix
such as
sha256=: the tool tells you whether it matches.
The settings
- How the key is written tells the tool how to turn it into bytes. Most services hand you a secret that their code uses as is, as text: that is the “Text (UTF-8)” setting, used for the generated key. If your code decodes the key first (for example 64 hex characters into 32 bytes), pick “Hexadecimal” or “Base64”: the two choices produce different signatures.
- The algorithm: HMAC-SHA-256 by default, the webhook standard. HMAC-SHA-384 and HMAC-SHA-512 produce longer signatures; HMAC-SHA-1 is there for older services that require it, and remains sound for this use.
Reading the results
A signature is a sequence of bytes (32 for SHA-256), shown here in three ways: hexadecimal,
the most common; the header form sha256=…, which GitHub uses in
X-Hub-Signature-256; and Base64, more compact, which other services prefer.
When a service also signs a timestamp, the message to paste is the one it builds. For Stripe, that is the
t value from the Stripe-Signature header, a dot, then the body:
1700000000.{"id":"evt_…"}; the signature to check is the v1 value.
The message field works on UTF-8 text, and browsers store its line endings as LF. For a body with CRLF line endings or binary content, run the calculation in your own code: the guide on how to verify a webhook signature has examples in Node.js and Python.
Sharing the key
HMAC does not encrypt anything: the message stays readable, only its origin is guaranteed. All the security therefore rests on the key, which the sender and the receiver must both hold, and nobody else. “Send with onlyU” passes this key, along with the algorithm name, to the team setting up the other end. The kit hands it to onlyU tab to tab in your browser, never in an address and never through the kit's server. onlyU encrypts it in your browser and creates a link that opens only once, valid for 24 hours, after which the link disappears. It is free, with no sign-up.