A keyed digest, not a hash of the joined strings
HMAC a message
HMAC mixes a secret key into the hash so someone who can see the message still cannot forge the tag. Hashing the key and the message yourself, one after the other, is not HMAC.
The key and the message are both UTF-8. The page imports the key into Web Crypto and signs with HMAC and the hash you pick. The tag is hex. SHA-256 is the match for the HS256 label you see on a JWT. This page does not build a JWT. It only produces the tag for the bytes you typed. An empty key is refused, because HMAC without a secret is just a hash under another name.
The key and the message are used in this tab and then discarded with the page. They are not sent to Glazlo.
This tool runs in your browser. Turn on JavaScript to use it.
HMAC-SHA-256 of glazlo with the key dev-key
Change either side and the hex changes. The JWT sample on the decode page uses this same key over the header and payload, which is a different message, so the tag is different too.
- Key
- dev-key
- Message
- glazlo
- HMAC-SHA-256
- 442b7f27bb1f7a6f9fb88dfc9de0f33e6ab6906a28e69c88c277480e96bcc532
How to use it
- 1Type the secret key. It is a password field so a glance does not reveal it.
- 2Type the message exactly, including spaces.
- 3Copy the hex tag. Compare it with the other side that shares the key.
Good to know
- The construction is HMAC, with inner and outer pads. It is not SHA-256(key + message).
- Keys longer than the hash block are hashed first by the algorithm. You do not need to pre-hash them here.
- A JWT check belongs on the JWT page, which feeds it the exact header.payload string.
Questions
Is HMAC encryption?
No. The message stays readable. The tag only shows whether the key-holder produced it.
Why is the JWT tag different from this example?
A JWT signs the Base64URL header, a dot, and the Base64URL payload. It does not sign the word glazlo.
Can I verify a tag as well as create one?
Compute it again with the same key, message, and hash. Equal hex means the tag matches.
Related tools
- Hash text or a file
A hash is a fixed-length fingerprint. The same bytes always produce the same digest, and the digest is not a way back to the file. Use it to compare a download or to spot a changed string.
- Decode a JWT
A JWT is header, payload, and signature, separated by dots. The first two parts are readable JSON. The third part is a signature over those two parts, not a place to hide the claims.
- Encrypt text with a passphrase
This page locks a message you can read again only with the same passphrase. The package is specific to Glazlo. OpenSSL and a password manager will not know the byte layout.