Skip to content

KMAC128 / KMAC256

A keyed MAC built directly on Keccak — the SHA-3 era replacement for HMAC, with no nested-hash construction needed.

Input

Secret

KMAC128

Enter something above to see the result.

Everything is processed locally in your browser. Your data never leaves this device.

HMAC without the nesting

HMAC exists because SHA-2 is vulnerable to length extension: you cannot simply hash key ‖ message. It works around this by hashing twice with two derived keys.

Keccak has no such weakness, so KMAC mixes the key straight into the sponge. It is simpler, faster, and specified in NIST SP 800-185.

The key, the output length and the customization string are all bound into the computation, so changing any of them changes the result — which is what stops one system’s MACs from being valid in another.

Frequently asked questions

Should I replace HMAC-SHA-256 with KMAC?

Only for new systems where both ends support it. HMAC-SHA-256 has no practical weakness and is available everywhere; KMAC is cleaner but far less widely implemented.

What does XOF mode change?

In normal mode the requested output length is part of the input encoding, so a 32-byte and a 64-byte KMAC of the same input are unrelated. In XOF mode it is not, so the longer output extends the shorter one.

Related tools