Hash Generator
Computes checksums of text or files and compares them with an expected hash.
Create an HMAC signature for a message or file with a secret key, using SHA-1, SHA-256, SHA-384, or SHA-512. Paste an expected signature to check that it matches.
Signed as UTF-8. A trailing space or line break changes the result.
HMAC (hash-based message authentication code, RFC 2104) mixes a secret key into a hash of the message:
HMAC(K, m) = H((K′ ⊕ opad) ‖ H((K′ ⊕ ipad) ‖ m))
Only someone with the same key can produce the same signature, so the receiver can tell the message wasn't changed and came from a key holder. The calculation uses your browser's Web Crypto API; text is signed as UTF-8 bytes.
key, message The quick brown fox jumps over the lazy dog, HMAC-SHA256 = f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8.Key (capital K) gives a completely different signature, which is why keys must match exactly.| Algorithm | Signature length | Hex characters | Use |
|---|---|---|---|
| HMAC-SHA1 | 160 bits | 40 | Older APIs, TOTP codes |
| HMAC-SHA256 | 256 bits | 64 | The default for webhooks, JWT (HS256), AWS SigV4 |
| HMAC-SHA384 | 384 bits | 96 | JWT HS384 |
| HMAC-SHA512 | 512 bits | 128 | JWT HS512, high-security settings |
hash_equals or crypto.timingSafeEqual.A hash can be computed by anyone. An HMAC also needs a secret key, so it proves that whoever made it knew the key.
Yes for HMAC. The known SHA-1 collision attacks don't break HMAC-SHA1. For new systems, HMAC-SHA256 is still the better choice.
Usually the body was changed before signing, for example parsed and re-serialized as JSON, or the key has extra spaces. Sign the raw body bytes with the exact secret.
No. The signature is calculated in your browser with Web Crypto, and the key and message stay on your device.
Often used together with the HMAC Generator.
Computes checksums of text or files and compares them with an expected hash.
Decodes JSON Web Tokens, explains the claims, and verifies HS, RS, PS, and ES signatures.
Encodes and decodes Base64 for text and files.