Signature Verification

Security

// Definition

The process of recomputing a cryptographic signature from a known algorithm, key, and payload, then comparing the result to the signature provided by the sender. If they match, the payload is authentic (originated from a party holding the secret) and unmodified in transit. Webhook signature verification uses HMAC-SHA256: the receiver recomputes HMAC(payload, shared_secret) and compares it to the signature header (e.g. X-Hub-Signature-256, Stripe-Signature, X-Shopify-Hmac-Sha256). Testing checklist: correct signature → accepted (200); tampered payload with original signature → rejected (401/400); missing signature header → rejected; signature for a different payload → rejected; replayed valid signature after expiry window → rejected.

// Related terms