HMAC SHA256 / SHA512 Signature Generator
RFC 2104Calculate and verify Keyed-Hash Message Authentication Codes (HMAC) for webhook signing (Stripe, GitHub, Shopify, Slack, Twilio) directly in browser memory. Supports SHA-256, SHA-512, SHA-384, SHA-1, and MD5 with zero server transmission.
Shared Secret Key
Message / Raw Payload
Multi-Format Encodings
Instant One-Click CopyReady-to-Use Webhook Headers
X-Hub-Signature-256)Stripe-Signature)X-Shopify-Hmac-Sha256)X-Slack-Signature)How HMAC Authentication Works
HMAC uses a two-pass hash calculation defined in RFC 2104: H((K ⊕ opad) || H((K ⊕ ipad) || M)). Inner and outer padding masks prevent length-extension attacks that cripple standard hash concatenation.
Preventing Replay Attacks
Top providers like Stripe and Slack prepend a Unix timestamp (e.g. t.payload) into the signed string. Always reject webhooks older than 5 minutes to render network-sniffed replays useless.
Timing-Safe String Comparison
Standard comparisons (==) return false on the first mismatch. Use crypto.timingSafeEqual() or hmac.compare_digest() to avoid sub-microsecond timing leak side-channel attacks.
Webhook Signature Specifications Comparison
| Service | Algorithm | HTTP Header Name | Output Encoding | Payload Format |
|---|---|---|---|---|
| GitHub | HMAC-SHA256 | X-Hub-Signature-256 | Hex (sha256=...) | Raw request body |
| Stripe | HMAC-SHA256 | Stripe-Signature | Hex (t=...,v1=...) | Timestamp + '.' + Raw body |
| Shopify | HMAC-SHA256 | X-Shopify-Hmac-Sha256 | Base64 | Raw request body |
| Slack | HMAC-SHA256 | X-Slack-Signature | Hex (v0=...) | v0 + ':' + Timestamp + ':' + Body |
| Twilio | HMAC-SHA1 | X-Twilio-Signature | Base64 | Full URL + Sorted POST params |
| AWS SigV4 | HMAC-SHA256 | Authorization | Hex lower | Derived signing key + string-to-sign |