Apex › Cryptography

HMAC — keyed message authentication

How you prove a message came from someone holding a shared secret and wasn't tampered with — the MAC behind TLS, JWTs (HS256), webhook signatures, and AWS request signing. Naive keyed hashing H(key ‖ msg) is broken by length extension; HMAC hashes twice with two key-derived pads so there's nothing to extend. Type a key and message and watch it build from real SHA-256, matching the RFC 4231 vectors.

More in Cryptography