Debugging webhook signatures without leaking secrets
Webhook signature mismatches are one of the most annoying integration bugs because the error is almost always a single invisible byte. When GitHub sends X-Hub-Signature-256, Shopify sends X-Shopify-Hmac-Sha256, or Stripe sends Stripe-Signature, your backend has to reproduce the exact HMAC digest from the shared secret and the unmodified HTTP body.
This page runs crypto.subtle.importKey("raw", ...) and crypto.subtle.sign("HMAC", ...) directly inside your browser tab. Your webhook signing secret and customer payload stay on your own machine. Paste the secret, drop in the raw payload, and check the live byte counters to confirm you are signing the exact string your server received.
Three provider quirks that break HMAC checks
If your server signature does not match what you compute here, check these three platform-specific details:
- GitHub prepends
sha256=to the lowercase hex digest inX-Hub-Signature-256. Our comparison input stripssha256=,sha512=, andv1=prefixes automatically when checking for a match. - Stripe does not sign the raw JSON body alone. It signs
<timestamp>.<raw_body>using thet=value from theStripe-Signatureheader separated by a literal period. - Shopify encodes its HMAC-SHA256 digest in standard Base64 rather than Hex. Switch the Output Encoding dropdown to Base64 when comparing against Shopify headers.
Why you should never roll your own hash(secret + message)
Concatenating a secret key and a message inside plain SHA-256 or SHA-512 is vulnerable to length-extension attacks on Merkle-Damgard hash functions. RFC 2104 HMAC hashes the key and message in two nested passes with inner and outer padding constants (0x36 and 0x5c), closing that attack vector cleanly.
Need a fresh 256-bit webhook signing secret before wiring up HMAC? Generate one with a whsec_ prefix in our Random Token Generator. If you are inspecting signed HS256 JSON Web Tokens, use our JWT Decoder & Inspector.