HMAC Generator

Generate Keyed-Hash Message Authentication Codes (HMAC) for messages client-side using SHA-1, SHA-256, SHA-384, or SHA-512. Verify signatures in real-time. 100% private browser execution.

Loading HMAC Generator workspace...

What is an HMAC Generator?

Overview and core technical concepts

An HMAC (Hash-based Message Authentication Code) Generator computes cryptographic signatures by combining a secret key with a cryptographic hash function (SHA-256, SHA-512, SHA-3, MD5) to verify data integrity and message authenticity.

Supports SHA-256, SHA-512, SHA-384, SHA-1, and MD5 algorithms
Configurable Hex, Base64, and Base64URL output encodings
Used by Stripe, GitHub, and Shopify webhook signature verification
100% Client-side browser calculation via Web Crypto API

Why Use HMAC Signatures?

Key advantages, developer speedups, and security benefits

Verify Webhook Payloads

Ensure third-party HTTP webhooks originated from trusted providers (Stripe, GitHub, Slack) and were not forged.

Prevent Data Tampering

Detect unauthorized modifications to API request parameters in transit without revealing the secret key.

When Shouldn't You Use HMAC?

Anti-patterns, limitations, and when to choose an alternative approach

Password Storage & Hashing

HMAC is designed for message verification, not password hashing. Use salted Bcrypt, Argon2, or PBKDF2 for passwords.

HMAC Signature Generation

Sample inputs, expected outputs, and code patterns

HMAC-SHA256 Webhook Verification Signature

Input
Key: secret_key_123 | Message: {"event": "payment.success"}
Expected Output
8b7e28b12270921074719e794fb77d33d9f1c7d24a9a08e1a1419736c84b1263

Common HMAC Mistakes

Frequent errors, security risks, and how to fix them

Exposing HMAC Secret Keys in Client-Side Frontend Code
The Mistake:Embedding secret HMAC keys in public React/Vue single-page web apps.
The Impact:Allows attackers to reverse-engineer keys and forge valid webhook signatures.
How to Fix:Always perform HMAC key signing on secure server backend microservices.

Frequently Asked Questions

HMAC stands for Keyed-Hash Message Authentication Code. It is a specific type of message authentication code (MAC) involving a cryptographic hash function and a secret cryptographic key. It is used to simultaneously verify both the data integrity and the authenticity of a message, ensuring it has not been modified in transit and that it indeed originated from a sender possessing the secret key.

A regular hash (like SHA-256) only checks data integrity: if the input changes, the hash changes. However, anyone can compute a hash. An HMAC uses a secret cryptographic key alongside the message. Because only authorized parties share the secret key, attackers cannot generate a valid HMAC signature for modified payloads. This provides authenticity in addition to integrity verification.

No. Encryption is a two-way function used to hide information (confidentiality). It allows ciphertext to be decrypted back to plaintext with a key. HMAC is a one-way signature function used for validation (integrity and authenticity). You cannot decrypt or recover the original message from an HMAC signature.

Yes. ToolZeno operates 100% client-side. When you type your secret key or load message vectors, all cryptographic computations run locally inside your browser sandbox using JavaScript and the Web Cryptography API. No content, keys, or messages are ever transmitted to our network or external servers, guaranteeing complete confidentiality.

HMAC is widely used in API authentication systems, webhooks, and secure message exchanges. For example, GitHub, Stripe, and Slack sign webhook HTTP headers with an HMAC calculated using a shared secret key. Developers verify these headers by computing the HMAC of the received request payload and comparing it with the header signature.