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.
- Brute force
- Effective only against short keys: 56-bit DES fell in 1998. Against 128-bit keys it is impractical.
- Keystream reuse
- In a stream cipher, encrypting two messages with the same keystream lets an attacker cancel it out with an XOR and learn about the texts.
- Wrong modes
- ECB reveals the structure of the data; predictable initialisation vectors and repeated nonces open other holes.
- Known plaintext
- Knowing parts of the message helps against weak ciphers; modern ones are designed to resist it.
- Side channels
- Execution times, power consumption and emissions can reveal the key if the implementation is not protected.
- Key management
- Keys written into code, stored in plain text or derived from weak passwords: the most common weak point.
Symmetric encryption today
Where symmetric encryption is used every day and which algorithms are recommended: AES-GCM, ChaCha20-Poly1305, disk encryption.
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: try it yourself
Exercises on XOR, counting keys and brute force, with solutions.
Symmetric encryption: frequently asked questions
Short answers to the most common doubts about symmetric encryption.