Every provider signs a slightly different string
GitHub's X-Hub-Signature-256 is an HMAC-SHA256 over the raw request body, written as sha256= and 64 hex characters. Stripe's Stripe-Signature is an HMAC over the timestamp, a dot, and the body, sent as t=,v1= pairs. Slack's X-Slack-Signature signs v0:{timestamp}:{body} and sends only v0=. The differences look arbitrary and are not: each one was chosen to bind a different set of facts.
| Provider | String signed | Header |
| GitHub | body | X-Hub-Signature-256: sha256=… |
| Stripe | {t}.{body} | Stripe-Signature: t=…,v1=… |
| Slack | v0:{t}:{body} | X-Slack-Signature: v0=… |
The bytes, not the object
The single most common failure is a body that was parsed and re-encoded before it was hashed. JSON has many spellings of the same value: key order, whitespace, whether a slash is escaped, how a non-ASCII character is written. A framework that turns the body into an object and back produces different bytes, and the digest changes with them. The fix is to read the body as a byte string once, verify against that, and only then parse it.
This is also why the string that gets signed is printed above the result. When a server disagrees with this page, the two strings are the thing to compare, not the two digests.
Why a timestamp is in the signature
A signature over the body alone is valid as long as the body is. Anyone who can read one request, from a proxy log, a misconfigured queue or an error tracker, can send it again and the receiver will accept it. Putting a timestamp inside the signed string makes each request valid only near its own time, and the receiver enforces that by rejecting anything outside a window. Five minutes is the common value: long enough for clock drift and a slow retry, short enough that a leak is stale before it is useful.
Comparison, and the reason it is written oddly
A normal string comparison returns as soon as two characters differ. Timing that tells an attacker how many characters of a guess were right, one byte at a time, which is enough to forge a signature a byte per request. A constant-time comparison reads both values completely and combines the differences without branching, so the time does not depend on where the first difference is. Every HMAC library has one, and writing === in its place is the bug that looks like nothing.
What a valid signature still does not say
It says the sender knew the secret. It does not say the event is new, correct, or one you want. Providers retry, so the same event will arrive twice; a compromised integration signs its own bad events; and an event you handled a month ago can be delivered again by a provider repairing a queue. Verify first, then deduplicate on the event id, and treat the payload as untrusted input even after the signature passes.
When the signed thing is a token that a browser carries rather than a request body, Pikkola JWT reads it. When the signature algorithm itself is what you need, Pikkola Hash covers the digests underneath.