CyberKit

HMAC

Also called Hash-based Message Authentication Code.

A keyed hash that proves a message's integrity and authenticity.

What it is

A construction that combines a cryptographic hash with a secret key to produce a message authentication code. Only parties holding the key can generate or verify a valid HMAC.

Why it matters

HMAC proves both that data was not tampered with and that it came from someone with the key, which a bare hash cannot. It secures API tokens, session cookies, and protocol messages, so a leaked HMAC key lets an attacker forge trusted requests.

In practice

An API signing each request with HMAC-SHA256 so the server rejects any tampered or unauthenticated call.

What to look for

  • Message signatures or webhook secrets using HMAC-SHA256.
  • Comparisons done with normal string equality instead of constant time.
  • Shared secrets that are short or reused across systems.

Common mistake

Using a plain hash of key plus message. That construction is open to length extension; HMAC is built to avoid it.

Practice it nearby

CyberKit has no tool for this term itself. These are the closest places to practice it.

In the field

Well-known tools where this shows up on the job. They are listed to show the landscape, not as a recommendation.

  • OpenSSL Open source

    The command line toolkit for inspecting certificates, keys and TLS connections.

  • HashiCorp Vault Source available

    Manages secrets and encryption keys, and can encrypt data as a service.

  • AWS Key Management Service Cloud service

    AWS's managed service for creating and controlling encryption keys.

Read next

Sources