KMAC256 File MAC Calculator

Compute the KMAC256 authentication tag of a file with your secret key and customization string, locally in your browser, and compare with an expected tag.

A multiple of 8, from 8 to 16384 bits.

Optional domain-separation label, e.g. your application name. Different strings give unrelated outputs.

The key is empty. Without a secret key, KMAC does not authenticate anything.

No file selected yet. The checksum appears as soon as you pick a file.

The file is read in chunks inside your browser and is never uploaded.

What is KMAC256 File MAC?

This tool computes the KMAC256 tag of a file using a secret key, an optional customization string and the output length you choose, and compares it with an expected tag. Unlike a plain checksum, a matching tag shows the file was produced by someone who knows the key.

How to use KMAC256 File MAC

  1. Enter the Secret key and Key encoding, plus an optional Customization string (S) and Output length (bits); changing them recomputes the tag.
  2. Click the drop zone or drag a file onto it; the file is read in chunks and a progress bar is shown.
  3. Check the File name and File size shown below to make sure you picked the right file.
  4. Paste the checksum published by the provider into Expected checksum — you get Match or Mismatch (case, 0x and a trailing file name are ignored).
  5. Choose the Output format and click Copy to store or send the tag.

Example

Input
A file hash-abc.txt containing "abc", key "secret" (UTF-8), S empty
Output
e0f722587fac65afa0b2e31856349bfc14d2eb8abc4ee0df330e2dd774d2290b75fdb129e27786af23258631b9eaccf317d4718f5d64dd91cc41b3c42395de42

Output length 512 bits.

When to use KMAC256 File MAC

Use it to check that a file comes from a party sharing your secret key, or to create tags for files in a KMAC-based system. To verify a public download, a checksum or digital signature is the right tool — a MAC requires both sides to share the key.

How KMAC256 File MAC works

The padded key is absorbed first, then the file in 4 MB slices, then the encoded output length, before the tag is squeezed. KMAC256 (NIST SP 800-185) is cSHAKE256 with function name "KMAC". It absorbs bytepad(encode_string(K), 136) — the key padded to a full block — then the message, then right_encode(L) with the requested output length L, and squeezes L bits. Because L is part of the input, a 256-bit and a 512-bit KMAC of the same data are unrelated (unlike SHAKE). The sponge design makes the simple key-prefix construction secure, so KMAC does not need HMAC's nested structure.

Common Use Cases

  • Verify the authenticity tag of a firmware or backup file
  • Create keyed fingerprints of files that outsiders cannot reproduce
  • Test a KMAC implementation on large inputs

Security Note

Use a random secret key of at least 32 bytes. The tag offers no protection if the key leaks. All processing is local.

FAQs

Are the file and key uploaded?

No. Both stay in your browser; the file is read locally in chunks.

Why does my tag not match?

Key bytes (check the key encoding), customization string and output length must all match exactly, as well as the file content.

Is a KMAC tag a signature?

No. Anyone with the shared key can create a valid tag, so it proves possession of the key, not the identity of one specific signer.

Explore more categories