BroadNet
Protocols BroadNet answer

HMAC-SHA256 for DLR webhook signing — how and why

Last reviewed 1 min readReviewed by BroadNet engineering
Quick answer

HMAC-SHA256 is the cryptographic primitive every modern messaging platform uses to sign delivery-receipt and inbound-message webhooks. The platform computes a keyed hash over the request body using a shared secret; your endpoint recomputes the same hash and compares. This proves the webhook came from the platform — not from someone who guessed your URL — and that the body was not tampered with in transit.

Plain-language definitionVendor-neutralReviewed September 24, 2026
The long answer

Everything worth knowing, nothing that isn't.

§01

How the signature is constructed

A common construction builds the canonical string as `${timestamp}.${requestBody}`, computes `HMAC-SHA256(canonical, secret)`, hex-encodes it, and sends the digest and the timestamp in a signature header. Including the timestamp inside the signed payload prevents replay attacks — your endpoint should reject webhooks more than 5 minutes old. Header names and the exact canonical format differ between platforms, so confirm them with your provider before writing verification code.

§02

Why HMAC and not RSA signatures

HMAC is symmetric — both sides share a secret — which means signing and verification are roughly 10,000x faster than RSA-2048. For webhook fan-out where a single SMSC may emit 50,000 DLRs/second, RSA signing dominates CPU. HMAC-SHA256 on modern hardware is single-digit microseconds. The trade-off: anyone with the secret can sign, so the secret should be shared only between the platform and your environment, stored like any other credential, and rotatable on demand.

§03

Verification gotchas

Three common bugs. Comparing strings with `==` instead of a constant-time comparison (timing attack — use `crypto.timingSafeEqual`). Validating the signature after JSON-parsing the body (you must verify the raw bytes, not a re-serialized representation — JSON reordering breaks the hash). Forgetting the timestamp anti-replay window.

§04

Beyond HMAC

For regulated environments (banks, healthcare), some platforms also support mTLS webhook delivery — the sender presents a client certificate that your load-balancer validates before the request reaches the application. This is stronger than HMAC because it binds delivery to a hardware key, but it only justifies its cost for genuinely sensitive workloads. For most integrations, HMAC-SHA256 over HTTPS is the right answer.

BNWritten by the BroadNet engineering team·Operating carrier-grade messaging since 2003, headquartered in Dubai·Editorial standards
Build with this

Need help wiring this up?

The pages below are the products and integration guides that put this concept on the wire. If you'd rather walk through it live, our engineering team takes calls same-day during MENA working hours.

Talk to our engineering team
Feedback

Was this answer helpful?

Your vote helps us prioritise which answers to expand with examples, diagrams, and code snippets.

Was this answer helpful?
Thanks — noted. We'll keep this answer maintained.
Got it. Tell us what was missing — send a quick note.

How we write and review content

Still need help?

Talk to a real engineer about your build.

We reply within one business day, and production accounts get 24/7 support. Our solutions engineers ship code, not scripts.

$ curl -X POST https://api.broadnet.me/sms/sendSms
Response SLA
Test-access requestsReply within 1 business day
Production24 / 7 · < 15 min
Operator NOC24 / 7 · pager