Poly1305 MAC Generator & Verifier Online - Message Authentication

Poly1305 MAC Generator & Verifier

Generate and verify 16-byte authentication tags for messages using 32-byte keys. Fast, secure message authentication.

128-bit Security

Generate MAC

Authentication Tag

Must be exactly 32 bytes (64 hex characters)

Generated MAC (16 bytes / 128 bits)
MAC tag will appear here...

Verify MAC

Verification

Verification Result

Enter the key, message, and MAC to verify.

About Poly1305 Message Authentication Code

Poly1305 is a cryptographic message authentication code (MAC) designed by Daniel J. Bernstein. It provides data integrity and authenticity verification with proven security guarantees.

Critical Security Rule: Never reuse a Poly1305 key for multiple messages! Each key should be used exactly once. For multiple messages, use ChaCha20-Poly1305 AEAD which derives unique keys automatically.

MAC Comparison

Algorithm Key Size Tag Size Speed Notes
Poly1305 256-bit 128-bit Very Fast One-time key only
HMAC-SHA256 Variable 256-bit Fast Reusable key
GMAC (AES-GCM) 128/256-bit 128-bit Fast (with AES-NI) Part of GCM mode
CMAC (AES) 128/256-bit 128-bit Medium Block cipher based

How Poly1305 Works

Poly1305 computes a 16-byte authenticator of a message using a one-time key:

  1. The message is broken into 16-byte blocks
  2. Each block is treated as a 129-bit little-endian integer
  3. Blocks are evaluated as a polynomial modulo the prime p = 2^130 - 5
  4. The result is added to the secret "s" value to produce the MAC

Usage Example

// Using TweetNaCl.js const nacl = require('tweetnacl'); // Key must be 32 bytes (use only once!) const key = nacl.randomBytes(32); // Message to authenticate const message = new TextEncoder().encode("Hello, World!"); // Generate MAC (16 bytes) const mac = nacl.lowlevel.crypto_onetimeauth( new Uint8Array(16), message, message.length, key ); // Verify MAC const isValid = nacl.lowlevel.crypto_onetimeauth_verify( mac, message, message.length, key ); console.log(isValid); // 0 if valid
Try other encryption, hashing, and signing utilities.