HMAC Generator Online – Free | 8gwifi.org

HMAC Generator

Keyed Hash Integrity + Auth API Signing
Anish Nath
Generate HMAC
Message
The message you will later verify with the same key and algorithm.
Secret Key
Use a high-entropy key. Keys are never stored on disk.
Algorithms
Recommended
Other Algorithms
Legacy (Testing Only)
OpenSSL Commands

Generate HMAC-SHA-256 from command line:

echo -n "message" | openssl dgst -sha256 -hmac "secret-key"

Using a key file:

openssl dgst -sha256 -hmac "$(cat keyfile)" -binary message.txt | base64
HMAC Results
HMAC Results Will Appear Here

Enter a message, secret key, select algorithms, then click Compute HMAC

Algorithm Guide
Algorithm Output Size Status
HMAC-SHA-256 256 bits (32 bytes) Recommended
HMAC-SHA-512 512 bits (64 bytes) Recommended
HMAC-SHA-1 160 bits (20 bytes) Legacy
HMAC-MD5 128 bits (16 bytes) Weak
HMAC-RIPEMD-160 160 bits (20 bytes) Niche
Understanding HMAC
What is HMAC?

HMAC (Hash-based Message Authentication Code) is a construction that combines a cryptographic hash function with a secret key. It provides two properties:

  • Integrity: Confirms the message hasn't been modified
  • Authentication: Proves the sender knows the shared secret

The HMAC formula: HMAC(K, m) = H((K ⊕ opad) || H((K ⊕ ipad) || m))

Why Use HMAC Instead of Plain Hash?

A plain hash like SHA-256(message) only detects accidental changes. Anyone can recompute it. HMAC adds a secret key so only authorized parties can generate or verify the MAC.

Common Use Cases
  • API Request Signing: AWS Signature V4, Stripe webhooks
  • JWT Tokens: HS256 algorithm uses HMAC-SHA-256
  • Webhook Verification: GitHub, Slack webhook signatures
  • Key Derivation: HKDF uses HMAC internally
  • VPN/IPsec: Integrity protection in network protocols
Key Strength Recommendations
  • HMAC-SHA-256: Use 256-bit (32 byte) keys
  • HMAC-SHA-512: Use 512-bit (64 byte) keys
  • Minimum: 128-bit (16 byte) random key
  • Always use cryptographic random generator
Code Examples

Python

import hmac
import hashlib

key = b'secret-key'
message = b'Hello, World!'
signature = hmac.new(key, message, hashlib.sha256).hexdigest()
print(signature)

Node.js

const crypto = require('crypto');

const key = 'secret-key';
const message = 'Hello, World!';
const hmac = crypto.createHmac('sha256', key)
                   .update(message).digest('hex');
console.log(hmac);
Security Standards & References

Support This Free Tool

Every coffee helps keep the servers running. Every book sale funds the next tool I'm dreaming up. You're not just supporting a site — you're helping me build what developers actually need.

500K+ users
200+ tools
100% private
Privacy Guarantee: Private keys you enter or generate are never stored on our servers. All tools are served over HTTPS.