Symmetric cipher reference
Symmetric ciphers use the same secret key to encrypt and decrypt. They are fast and used for bulk data: TLS records, disk encryption, file encryption and tokens. This reference compares AES, ChaCha20, 3DES, Blowfish and others by key size, block size, the recommended mode of operation, and current security status.
How it works
A block cipher (AES, 3DES) transforms fixed-size blocks; a stream cipher (ChaCha20) produces a keystream XORed with the plaintext. Security depends heavily on the mode of operation:
- AEAD modes (GCM, CCM, ChaCha20-Poly1305) encrypt and authenticate together — always prefer these.
- CBC needs a separate MAC and a random IV, and is error-prone (padding-oracle attacks).
- CTR is parallelisable but needs an external MAC.
- ECB is insecure — it leaks plaintext patterns.
Each encryption needs a unique nonce/IV per key; reusing a GCM nonce is catastrophic and can reveal the authentication key.
Tips and notes
- Default to AES-256-GCM or ChaCha20-Poly1305 for new systems.
- Never reuse a nonce with the same key under GCM or CTR.
- Avoid 3DES, RC4 and Blowfish for new designs — they are deprecated or have small block sizes.
- Key size is not the whole story: a 256-bit key in ECB mode is still insecure because of the mode, not the key.