HomeHome
HMAC Generator

HMAC Signature Generator & Verifier

RFC 2104 / FIPS 198-1

Calculate and verify RFC 2104 Keyed-Hash Message Authentication Codes across HMAC-SHA256, HMAC-SHA512, HMAC-SHA1, and HMAC-MD5 with timing-safe verification.

Shared Secret Key

46 bytes(368 bits)Industry Standard (256 bits)

Message / Raw Payload

381 chars•381 bytes•18 lines
Calculated HMAC-SHA-256
0 ms•0 chars
Enter secret key and message to calculate signature...
Encoding: hex-lower

Multi-Format Encodings

Instant One-Click Copy
Hex (lowercase)
-
HEX (uppercase)
-
Base64 (Shopify / Twilio)
-
Base64URL (URL-Safe)
-

Ready-to-Use Webhook Headers

Live Simulated
GitHub (X-Hub-Signature-256)
sha256=
HMAC-SHA256 hex digest prefixed with sha256=
Stripe (Stripe-Signature)
t=1774000000,v1=
Concatenated timestamp t and v1 hex signature
Shopify (X-Shopify-Hmac-Sha256)
HMAC-SHA256 encoded directly in standard Base64
Slack (X-Slack-Signature)
v0=
Prefixed with v0= and computed on v0:timestamp:body

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

ServiceAlgorithmHTTP Header NameOutput EncodingPayload Format
GitHubHMAC-SHA256X-Hub-Signature-256Hex (sha256=...)Raw request body
StripeHMAC-SHA256Stripe-SignatureHex (t=...,v1=...)Timestamp + '.' + Raw body
ShopifyHMAC-SHA256X-Shopify-Hmac-Sha256Base64Raw request body
SlackHMAC-SHA256X-Slack-SignatureHex (v0=...)v0 + ':' + Timestamp + ':' + Body
TwilioHMAC-SHA1X-Twilio-SignatureBase64Full URL + Sorted POST params
AWS SigV4HMAC-SHA256AuthorizationHex lowerDerived signing key + string-to-sign

Zero-Knowledge Local Execution

All data processing, parsing, and compilation execute strictly inside your local browser memory. Zero external server uploads.

Instant Local Cryptography

Instant real-time reactive computation delivers immediate feedback on every keystroke with zero network latency.

Production Standards & Compliance

Follows modern browser Web Crypto and security practices for safe client-side inspection.

Technical Reference & Architecture Guide

HMAC Signature Generator & Verifier — Reference Guide

Calculate and verify RFC 2104 Keyed-Hash Message Authentication Codes across HMAC-SHA256, HMAC-SHA512, HMAC-SHA1, and HMAC-MD5 with timing-safe verification.

HMAC Signature Generator & Verifier — Reference Guide — Client-Side In-Memory Architecture & Data Flow
HMAC Signature Generator & Verifier — Reference Guide — Client-Side In-Memory Architecture & Data Flow
RFC 2104 Webhook Auth

Major Webhook HMAC Signature Schemes Reference Table

Standard Hash-based Message Authentication Code (HMAC) signature verification schemes across leading cloud and payment webhook providers.

Major Webhook HMAC Signature Schemes Reference Table
Service / PlatformHMAC AlgorithmHTTP Signature HeaderSigned Payload FormatSecret Key Format
Stripe WebhooksHMAC-SHA256Stripe-Signaturetimestamp + '.' + raw_bodywhsec_...
GitHub WebhooksHMAC-SHA256X-Hub-Signature-256Raw request body bytessha256=...
Shopify WebhooksHMAC-SHA256X-Shopify-Hmac-Sha256Raw request body bytesBase64 digest
Slack Events APIHMAC-SHA256X-Slack-Signature'v0:' + timestamp + ':' + bodyv0=...
AWS Signature v4HMAC-SHA256AuthorizationCanonical HTTP request + dateAWS4-HMAC-SHA256
Developer documentation for Stripe, GitHub, Shopify, Slack, and AWS APIs.

Key Parameters & Controls

Key Parameters & Controls
ParameterType / UnitDescriptionDefault
Hash AlgorithmEnum (SHA-256 | SHA-512 | SHA-384 | SHA-1 | MD5)Underlying cryptographic hash function for keyed hashing. SHA-256 is the universal standard for modern webhooks.SHA-256
Key EncodingEnum (UTF-8 | Hex | Base64)Encoding format of the shared secret key. Raw strings use UTF-8, while binary keys use Hex or Base64.UTF-8
Message EncodingEnum (UTF-8 | Hex | Base64)Encoding format of the raw payload string to be cryptographically signed.UTF-8
Output FormatEnum (Hex Lower | Hex Upper | Base64 | Base64URL)Signature representation format. GitHub and Stripe use Hex lower; Shopify and AWS use Base64.Hex Lower

Pro Tips & Best Practices

Standard string equality

Standard string equality (===) is susceptible to timing side-channel attacks. Our verifier implements constant-time O(1) byte comparisons.

GitHub sends sha256=<hex>

GitHub sends sha256=<hex> in X-Hub-Signature-256. Stripe concatenates t=<timestamp>.<payload> and signs with HMAC-SHA256.

Key size recommendation

RFC 2104 recommends secret keys equal to or larger than the hash block size (e.g. 32 bytes for SHA-256).

Common Gotchas & Troubleshooting

⚠️Signature verification fails for valid webhook payload

Ensure exact byte parity including raw whitespace, newlines, and verify whether the key is expected as raw UTF-8 or Hex.

⚠️Base64 vs Base64URL format discrepancy

REST APIs and JWTs replace '+' with '-' and '/' with '_' without '=' padding. Switch output format to Base64URL if needed.

Frequently Asked Questions

What is HMAC and why is it safer than simple hashing?▼

HMAC (Keyed-Hash Message Authentication Code) uses a double-nested hashing construction with inner and outer padding (ipad and opad). This mathematical design prevents length extension attacks that plague naive hash(key + message) constructions.

How do webhook signatures work in Stripe, GitHub, and Shopify?▼

Webhook providers sign outbound HTTP payloads using a shared secret key via HMAC-SHA256. Receivers compute the expected HMAC of the incoming raw request body and compare it with the signature in headers (e.g. Stripe-Signature or X-Hub-Signature-256) using timing-safe comparisons.

Why is timing-safe comparison critical for HMAC verification?▼

Standard string comparison operators (like === in JavaScript or == in Python) return early on the first mismatched character. Attackers can measure response latency in microseconds to infer correct signature bytes one by one. Constant-time comparison checks all bytes regardless of mismatches, eliminating timing leaks.

Can I test AWS SigV4 signatures with this tool?▼

Yes. You can enter intermediate signing keys (kDate, kRegion, kService) as Hex bytes and sign canonical request strings to debug and verify each step of the AWS Signature Version 4 calculation.