ChaCha20
ChaCha20 is a stream cipher designed by Daniel Bernstein, built on ARX (add-rotate-XOR) operations, and is commonly paired with Poly1305 as an AEAD — a high-performance alternative to AES-GCM.
Purpose
It provides fast, constant-time-secure encryption on platforms without AES hardware acceleration, avoiding AES timing side channels.
Mechanism
An improvement on Salsa20, it runs 20 rounds of quarter-round operations. The state is a 4×4 matrix (constants, key, counter, nonce). Each round applies add-rotate-XOR to columns and diagonals; the resulting keystream is XORed with the plaintext.
Use cases
- One of the default TLS 1.3 cipher suites
- WireGuard VPN
- Google server encryption
- Mobile encryption
Examples
- Input
key=256bit, nonce=96bit, counterOutputkeystreamCombined with Poly1305 as AEAD
Common errors
- Nonce reuse replays the keystream
- Use a unique nonce per message (e.g., a counter)
Related terms
Salsa20
Salsa20 is a stream cipher designed by Daniel Bernstein, built on ARX operations with 20 rounds; it is an eSTREAM-recommended algorithm and the predecessor of ChaCha20. GLOSSARY
AES
The Advanced Encryption Standard (AES) is the symmetric block cipher NIST standardized in 2001, supporting 128/192/256-bit keys, and is the de facto standard of modern encryption. GLOSSARY
GCM (Galois/Counter Mode)
GCM is an AEAD mode that combines CTR encryption with GHASH authentication, providing confidentiality and integrity at once, and is the preferred mode of TLS 1.2/1.3. GLOSSARY
Stream Cipher
A stream cipher encrypts byte by byte or bit by bit, XORing a keystream with the plaintext; it needs no padding and suits real-time and streaming data. GLOSSARY
Related tools
AES Encryptor
Encrypt text or binary data with AES (CBC/GCM/ECB) using Web Crypto API. Free, private, and 100% client-side. TOOL
ChaCha20 Encryptor
Encrypt text with the ChaCha20 stream cipher (RFC 8439) — a real algorithm verified byte-for-byte against official RFC test vectors. 256-bit key (32 bytes), 96-bit nonce (12 bytes), 32-bit block counter. Free, private, and 100% client-side. Never reuse a nonce with the same key. TOOL
ChaCha20 Decryptor
Decrypt ChaCha20 ciphertext (RFC 8439) — a real algorithm verified byte-for-byte against official RFC test vectors. Key must be exactly 32 bytes, nonce exactly 12 bytes, and the block counter must match the value used for encryption. Ciphertext input format follows the output format option (hex or base64). Free, private, and 100% client-side. TOOL