RFC 8439 synchronous authenticated encryption with 256-bit keys and constant-time software execution.
ChaCha20Poly1305 implements RFC 8439 authenticated encryption (ChaCha20 stream cipher + Poly1305 MAC) backed by @noble/ciphers/chacha.js. Unlike AesGcm, every operation is synchronous, takes a raw 32-byte Uint8Array key, and runs in constant time without hardware AES instructions.
Fixed 128-bit Poly1305 authentication tag length in bytes
Errors and Security Invariants
Never reuse a (key, nonce) pair. Reusing a nonce reveals the XOR of plaintexts and leaks the one-time Poly1305 key, allowing an attacker to forge tags on arbitrary messages.
Constant-time ARX design: ChaCha20 uses only 32-bit addition, rotation, and XOR (no S-box lookup tables), eliminating cache-timing channels on platforms without AES-NI.
Message limit: RFC 8439 uses a 32-bit block counter, limiting a single message to 2^32 - 1 64-byte blocks (~256 GiB). Rotate keys before 2^32 random-nonce messages.