hooksig

hooksig  /  Twilio

HMAC-SHA1 · base64 · no timestamp

Twilio

The SHA-1 outlier: it signs the URL plus your form params, sorted by name.

Try it — live, in your browser

HMAC-SHA1 · base64 · no timestamp
Request — edit anything
Verify this in code
import { verify } from "hooksig";

const result = await verify("twilio", {
  payload: rawBody,
  headers: request.headers,
  secret: env.WEBHOOK_SECRET,
  url: request.url,             // twilio signs the URL
});

if (!result.verified) {
  return new Response(result.reason, { status: 400 });
}
no match — signature invalid
Signed string
HMAC-SHA1( secret, signed string ) = expected
Expected vs provided
expected
provided
How it's built

    The scheme

    Gotchas

    Official Twilio docs →