# Webhook Signature

> A code sent with a webhook that proves who sent it and that nothing changed.

**Field:** Software Development  
**Category:** APIs  
**Also known as:** Webhook Verification, HMAC Signature, Signed Webhook, X-Hub-Signature-256

## Think of it like

Think of it like a wax seal on a letter. If the seal matches, you know who sent it and nobody opened it.

## Definition

A webhook signature proves a webhook really came from the service you expect. The sender and you share a secret key. The sender mixes the message with the secret to make a signature, usually with HMAC SHA-256. You make your own signature the same way and compare. If they match, the message is real and unchanged.

## Example

GitHub puts its signature in a header called X-Hub-Signature-256. It starts with sha256=. Lucy's server checks it before it trusts the event.

## Why it matters

A webhook URL is public. Without a check, anyone could send your server fake events.

## Common mistake

Checking the match with a plain string compare. Use a compare that takes the same time each try, so time gives no clues.

## Three principles

- **Shared secret.** Only you and the sender know it.
- **Make your own.** Compute it and compare.
- **Drop bad ones.** No match means not trusted.

## Related terms

- [Webhook](https://learn.benibix.com/term/development/webhook)
- [Hashing (Cryptography)](https://learn.benibix.com/term/development/hashing)
- [Secrets Management](https://learn.benibix.com/term/development/secrets-management)
- [API Key](https://learn.benibix.com/term/development/api-key)

![A sender and a receiver share one secret key. The sender takes the message body and the secret, makes a signature with HMAC SHA-256, and sends both, with the signature in a header that starts sha256=. The receiver, lit up, makes its own signature from the body and the same secret, and compares the two. If they match, the message is real. If not, it is thrown away.](https://learn.benibix.com/diagrams/dev3-webhook-signature.svg)

---

Source: https://learn.benibix.com/term/development/webhook-signature
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
