Symmetric encryption today
Where symmetric encryption is used every day and which algorithms are recommended: AES-GCM, ChaCha20-Poly1305, disk encryption.
- Web
- HTTPS connections encrypt data with AES-GCM or ChaCha20-Poly1305, after agreeing the key with public-key cryptography.
- Disks and phones
- Data at rest are encrypted with AES, often in a mode designed for disks.
- VPNs
- Encrypted tunnels use fast symmetric algorithms to protect all traffic.
- Messaging
- End-to-end encrypted apps use symmetric keys that change continuously.
- Archives
- Compressed archive formats and password managers encrypt content with 256-bit AES.
Current recommendations
- Use authenticated encryption: AES-GCM or ChaCha20-Poly1305.
- Use keys of at least 128 bits, preferably 256 for data to be protected long term.
- Never reuse the same nonce with the same key.
- Derive keys from passwords with slow, salted functions.
- Rely on well-tested libraries, not home-made implementations.
Symmetric encryption: try it yourself
Exercises on XOR, counting keys and brute force, with solutions.
The pages of this topic
Back to the overviewSymmetric encryption: how it works
How block and stream ciphers work, modes of operation and authenticated encryption.
Symmetric encryption: history
From the scytale and the Caesar cipher to polyalphabetic ciphers, from rotor machines to DES and AES.
Symmetric encryption: the maths
XOR and its properties, the size of the key space, brute force and the problem of the number of keys among many users.
Symmetric encryption: worked example
An example of XOR encryption on a single character and on a word, to see how the same key encrypts and decrypts.
Symmetric encryption: weaknesses and attacks
Brute force, reuse of keys and nonces, wrong modes, side channels and poor key management: how symmetric encryption is attacked.
Symmetric encryption: frequently asked questions
Short answers to the most common doubts about symmetric encryption.