Cryptography

ChaCha20-Poly1305

An AEAD combining the ChaCha20 stream cipher with the Poly1305 MAC, specified in RFC 8439 and fast without AES hardware.

ChaCha20-Poly1305 pairs Daniel Bernstein's ChaCha20 stream cipher with the Poly1305 one-time authenticator. It runs in constant time in pure software, so it beats AES-GCM on devices without AES instructions (older phones, small embedded parts) and avoids cache-timing pitfalls of table-based AES. It is a TLS 1.3 suite and the AEAD in WireGuard.

Like GCM it uses a 96-bit nonce in the IETF version, and nonce reuse is equally fatal. XChaCha20-Poly1305 extends the nonce to 192 bits, which makes random nonces safe for effectively unlimited messages per key; that is why libsodium recommends it when you cannot keep a counter.

Common confusion: the original Bernstein variant used a 64-bit nonce and a 64-bit counter, the IETF variant a 96-bit nonce and 32-bit counter (about 256 GiB per message). Libraries differ in which they expose, so check before interoperating.

Learn it properly

Compared

Also used in

Related terms