Verifying an inbound webhook signature
Stripe, GitHub and Shopify sign payloads with HMAC-SHA256 over the raw request body. Computing the expected value here shows whether a mismatch is a wrong secret or a body your framework already re-serialized.
Computes an HMAC — a keyed message authentication code — with SHA-1/256/384/512.
Computes an HMAC — a keyed message authentication code — with SHA-1/256/384/512.
message: "hello", key: "secret", algo: HMAC-SHA256
88aab3ede8d3adf94d26e90b5b1c4e2e...
The same message with a different key produces a different HMAC.
A valid HMAC proves the message came from someone with the key.
Your input is sent to YAS infrastructure because the tool requires server-side processing or public network queries. Input is not stored.
curl -X POST "https://yas.sh/api/v1/tools/hmac-generator" \
-H "Content-Type: application/json" \
-d '{"message":"hello","key":"secret","algorithm":"sha256"}'const res = await fetch("https://yas.sh/api/v1/tools/hmac-generator", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"message": "hello",
"key": "secret",
"algorithm": "sha256"
}),
});
const data = await res.json();import requests
r = requests.post("https://yas.sh/api/v1/tools/hmac-generator", json={"message":"hello","key":"secret","algorithm":"sha256"})
data = r.json()| Field | Type | Required | Description |
|---|---|---|---|
| message | string | Yes | Message |
| key | string | Yes | Secret key |
| algorithm | string | No (default sha256) | sha1 | sha256 | sha384 | sha512 |
{ "algorithm": "sha256", "hex": "2cf24dba5fb0a30e...", "base64": "LPI..." }Compute HMAC-SHA1/256/384/512 for a message and key.
400 VALIDATION_ERROR — invalid input or unsupported option.413 PAYLOAD_TOO_LARGE — input exceeds the 64 KB limit.429 RATE_LIMIT_EXCEEDED — rate limit exceeded (60 req/min).HMAC combines a secret key with a hash function in a specific nested construction defined in RFC 2104: H((K ⊕ opad) ‖ H((K ⊕ ipad) ‖ message)). The two distinct padding constants and the double hashing are what make it a proper message authentication code. Naively prefixing a key to a message and hashing it — H(K ‖ m) — is vulnerable to length-extension attacks against Merkle–Damgård hashes such as SHA-256, which HMAC is specifically designed to prevent.
The output proves two things at once: the message was not modified, and it was produced by someone holding the key. That is authentication, not encryption — the message itself remains readable. Keys shorter than the hash block size are zero-padded and longer keys are hashed down, so key length beyond the digest size adds no security.
Stripe, GitHub and Shopify sign payloads with HMAC-SHA256 over the raw request body. Computing the expected value here shows whether a mismatch is a wrong secret or a body your framework already re-serialized.
AWS SigV4 and similar schemes derive a signing key through chained HMACs. Reproducing one step at a time is the fastest way to find where your implementation diverges.
An unsubscribe or password-reset link can carry a payload plus an HMAC, letting the server detect any modification without a database lookup.
HMAC with a server-held key turns an email address into a stable pseudonym that cannot be reversed by dictionary attack, unlike a plain hash.
What this tool deliberately does not do, and where it will disagree with other implementations.