Symmetric encryption: try it yourself
Exercises on XOR, counting keys and brute force, with solutions.
Exercise 1: XOR by hand
Compute the XOR of 10110011 and 01101010. Then XOR the result with 01101010 again: what do you get?
Exercise 2: how many keys?
A company with 50 employees wants every pair of employees to have a different secret key. How many keys are needed? And if there are 500 employees?
Exercise 3: brute force
A key consists of 6 decimal digits. How many attempts are needed, at most, to find it? And if it consisted of 6 lower-case letters of the English alphabet?
Symmetric encryption: frequently asked questions
Short answers to the most common doubts about symmetric 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: 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 today
Where symmetric encryption is used every day and which algorithms are recommended: AES-GCM, ChaCha20-Poly1305, disk encryption.