HMAC-SHA-256 Calculator
HMAC-SHA-256 (RFC 2104)
Client-side computation for analysis, verification, and learning. Do not paste production secrets into untrusted sites; prefer local tooling for key material.
Educational / engineering use. RSA mode uses tiny primes for illustration only—not for real key generation.
Add HMAC-SHA-256 Calculator Free On Your Website
Paste this HTML on your site.
What is HMAC-SHA-256 Calculator?
HMAC combines a secret key with SHA-256 hashing to produce a message authentication code. Used to verify both data integrity and authenticity ensuring the message wasn't tampered with and came from a trusted source.
HMAC Formula
Where K' is key padded/hashed to 64 bytes, ipad = 0x36 repeated, opad = 0x5C repeated, || is concatenation, H = SHA-256.
HMAC Step-by-Step
- Enter secret key and message.
- Normalize key length.
- Build inner and outer padded keys.
- Compute inner hash then outer hash.
- Return HMAC tag.
HMAC Worked Example
Key: "secret", Message: "hello"
Step 1: Pad key to block size (64 bytes).
Step 2: Compute inner hash H((K XOR ipad) || message).
Step 3: Compute outer hash H((K XOR opad) || inner_hash).
Final HMAC:
88aab3ede8d3adf94d26ab90d3bafd4a
2083070c3bcce9c014ee04a443847c0b
Where HMAC-SHA-256 Calculator Is Applied
- AWS request signing (Signature Version 4)
- JWT token authentication (HS256)
- Webhook payload verification (GitHub, Stripe, Shopify all use it)
- OAuth 2.0 token validation
- API request integrity checks
- Cookie tamper detection in web applications
- Two-factor authentication (TOTP) — RFC 6238
Related Cryptography Calculators
Explore similar calculators to streamline your workflow.