# HMAC + BLAKE3 + SHA-3/Keccak + Poly1305 + BLAKE2 Keyed MAC Construction Linter

Compute and audit MACs across HMAC-SHA-2/SHA-3, keyed BLAKE2, BLAKE3, KMAC and Poly1305 with official known-answer self-tests, key/tag-length linting and a cross-construction compatibility matrix.

> Canonical page: https://elysiatools.com/en/tools/hmac-blake3-sha3-keccak-keyed-hash-and-mac-construction-linter

- **Category:** Cryptography

- **Keywords:** hmac linter, mac audit, blake2 keyed mac, blake3 keyed hash, kmac, cshake, poly1305 one-time, sha3 keccak, rfc 4231 vectors, tag truncation

## Overview

Every tag is produced by a verified implementation: HMAC uses OpenSSL via node:crypto; BLAKE2/BLAKE3/KMAC/Poly1305 run as pure TypeScript checked against the official BLAKE2 KAT, BLAKE3 test vectors, NIST SP 800-185 KMAC samples, RFC 8439 §2.5.2 and FIPS 202. Security levels follow NIST SP 800-107 (HMAC strength = min(key bits, hash output bits), forgery bound 2^(t/2) for a kept tag of t bits), SP 800-185 (KMAC = min(key, 2·tag, c/2 bits)) and RFC 8439 (Poly1305 one-time, ≤ 8⌈L/16⌉/2^106).

## Inputs

- **Message** (textarea): Payload to authenticate (e.g. webhook body, JWT signing input)
- **Message encoding** (select)
- **Key (hex)** (text): e.g. 0b0b0b... (20 bytes) or 000102...1f (32 bytes)
- **Kept tag length (bytes)** (number)
- **Domain-separation label (KMAC custom / BLAKE3 context)** (text): e.g. myapi/v1/webhook

## When to use

- Evaluating key sizes, tag lengths, and security bounds for API webhook signatures or token signing.
- Cross-checking custom MAC implementations against official NIST, RFC, and BLAKE test vectors.
- Auditing tag truncation risks when reducing authentication tag sizes below 128 bits.

## How it works

- Supply the input payload using plain UTF-8 text or raw hexadecimal bytes.
- Provide an authentication key in hex along with optional tag truncation byte length and domain-separation labels.
- The engine executes HMAC via OpenSSL and pure TypeScript implementations of BLAKE2, BLAKE3, KMAC, and Poly1305 checked against official test vectors.
- Review the generated report showing output tags, effective security strength in bits, lint warnings, and known-answer test statuses.

## Use cases

- Verifying webhook signature implementations against canonical RFC 4231 and NIST test vectors.
- Benchmarking tag truncation security trade-offs for embedded systems or bandwidth-constrained network protocols.
- Configuring domain-separated MAC architectures using KMAC custom strings or BLAKE3 key derivation contexts.

## Frequently asked questions

### Which keyed hash and MAC constructions are evaluated?

The tool audits HMAC (SHA-256, SHA-512, SHA3-256, SHA3-512), keyed BLAKE2s/BLAKE2b, BLAKE3 keyed hashing, KMAC128/KMAC256, and Poly1305.

### Why are BLAKE3 or Poly1305 marked as skipped in my report?

BLAKE3 keyed hashing and Poly1305 strictly mandate a 32-byte (256-bit) key and will not execute with keys of other lengths.

### How are cryptographic security levels calculated?

Security levels follow NIST SP 800-107 (min of key bits and hash output), NIST SP 800-185 for KMAC, and RFC 8439 for Poly1305 bounds.

### What happens when tag length is truncated?

The tag is shortened to the requested byte count and the linter calculates the reduced forgery resistance bound, issuing warnings if kept bits fall below 128.

### What is the custom label field used for?

The custom label sets the KMAC customization string and the BLAKE3 context string for domain separation and subkey derivation.

## Related tools

- [Hash Algorithm Comparator](https://elysiatools.com/en/tools/hash-algorithm-comparator): Hash the same input with MD5, SHA-1, SHA-256, SHA-512, BLAKE2b, and BLAKE3 at the same time and compare them side by side: output length, hex/Base64 digest, security status (broken / modern), and a relative speed benchmark. Great for teaching, choosing a hashing algorithm, or sanity-checking checksums.
- [Text Hash Generator](https://elysiatools.com/en/tools/text-hash-generator): Compute MD5, SHA-1, SHA-256, SHA-512, and CRC-32 hashes of any text in one shot. Get both hex and Base64 digests over the UTF-8 encoding.
- [BLS Boneh–Lynn–Shacham Threshold Signature Aggregation + Distributed Key Generation Simulator](https://elysiatools.com/en/tools/bls-boneh-lynn-shacham-threshold-signature-aggregation-distributed-key-gen-simulator): Simulate BLS12-381 BLS signatures end to end: Joint-Feldman DKG ceremonies, t-of-n threshold signing with Lagrange interpolation, the rogue-key attack and its proof-of-possession defense, and Ethereum 2 attestation aggregation.
- [OAuth 2.0 / OIDC Authorization Code with PKCE Flow Visualizer](https://elysiatools.com/en/tools/oauth-oidc-authorization-code-pkce-flow-visualizer): Simulate the Authorization Code flow with PKCE end to end: verifier/challenge generation, authorization URL, token exchange, ID Token validation checklist and an interception-attack demo.
- [PKCE Code Verifier & Challenge Generator](https://elysiatools.com/en/tools/pkce-code-verifier-generator): Generate, validate and verify OAuth2 / OIDC PKCE (RFC 7636) code_verifier and S256 code_challenge pairs. Three modes: (1) generate a fresh verifier + challenge from cryptographically secure random bytes at 256/384/512/768-bit entropy, (2) audit a verifier you already have against the RFC — length (43–128), charset \[A-Za-z0-9-._~\] and ≥256-bit entropy, and (3) verify a verifier/challenge pair by recomputing BASE64URL(SHA256(verifier)). Optionally build the full authorization-request URL and token-exchange body. Complements the generic nonce-generator (which only emits a verifier+challenge pair) with RFC-compliance auditing and pair verification.
- [RSA Encrypt / Decrypt](https://elysiatools.com/en/tools/rsa-encrypt-decrypt): Encrypt text with an RSA public key or decrypt ciphertext with the matching private key, using OAEP padding (SHA-1 or SHA-256). Handles long messages by chunking. Keys and data stay local. PKCS#1 v1.5 is intentionally not offered (Node disables it for decryption due to Bleichenbacher attacks).
- [Web Push RFC 8030 Request + VAPID + RFC 8291 Payload Encryption Encoder](https://elysiatools.com/en/tools/web-push-rfc8030-vapid-rfc8291-payload-encrypted-content-encoder): Encode a complete Web Push send: RFC 8291 aes128gcm payload encryption, RFC 8292 VAPID ES256 JWT, RFC 8030 headers, APNs/FCM cross-walk and decrypt round-trip verification.
- [CRC32 Checksum](https://elysiatools.com/en/tools/crc32-checksum): Compute the CRC32 checksum (IEEE 802.3 polynomial) of any text or raw bytes. Output as hex, decimal or binary. Accepts plain text (UTF-8) or raw bytes via hex/base64 input.

## Samples

- [MAC Address Samples](https://elysiatools.com/en/samples/mac-address): Collection of MAC addresses in various formats for validation testing
- [Copyright-Free MP3 Audio Samples](https://elysiatools.com/en/samples/mp3-samples): Collection of royalty-free audio samples for testing and development purposes including nature sounds, meditation music, and ambient audio
- [Android Image Processing Java Samples](https://elysiatools.com/en/samples/android-image-processing-java): Android Java image processing examples including reading/saving images, scaling, and format conversion
- [Android Image Processing Kotlin Samples](https://elysiatools.com/en/samples/android-image-processing-kotlin): Android Kotlin image processing examples including reading/saving images, scaling, and format conversion
