Block Ciphers
The basics.
What if we just encrypt all the blocks?
0x00) until the message length is a multiple of the block sizeFrom semantic security to chosen-plaintext attacks.
\[\text{CPA}_\text{adv}[\mathcal{A}, \mathcal{E}] \leq Q \cdot \text{SS}_\text{adv}[\mathcal{B}, \mathcal{E}]\]
What if we just XOR all the things?
What if we just build a stream cipher instead?
| ECB | CBC | CTR | |
|---|---|---|---|
| Encryption | \(c[i] = E(k, m[i])\) | \(c[i] = E(k, m[i] \oplus c[i{-}1])\) | \(c[i] = m[i] \oplus E(k, (n, \langle i \rangle_b))\) |
| Decryption | \(m[i] = D(k, c[i])\) | \(m[i] = D(k, c[i]) \oplus c[i{-}1]\) | \(m[i] = c[i] \oplus E(k, (n, \langle i \rangle_b))\) |
| \(\texttt{Enc}\) parallelisable | Yes | No | Yes |
| \(\texttt{Dec}\) parallelisable | Yes | Yes | Yes |
| Random read | Yes | Decryption only | Yes |
| Partial last block | Padding required | Padding required | Yes |
| IV / Nonce | None | Unpredictable IV | Unique nonce |
| Semantically secure | No | Yes | Yes |
| Notes | Leaks block equality | IV sent unencrypted | \(\texttt{Enc}\) = \(\texttt{Dec}\) (stream cipher) |
03 03 03 (base 16)06 06 06 06 06 06 (base 16)From round functions to full block ciphers.
A block cipher from the bad old days.
Rijndael to the rescue!
SubBytes: the substitution layer – applies a fixed S-box to each byte for non-linearityShiftRows + MixColumns: the permutation layer – linear diffusion across the block
ShiftRows cyclically shifts rows in a \(4 \times 4\) byte matrixMixColumns mixes columns using matrix multiplication in GF(\(2^8\))MixColumns to simplify decryption logicRotWord: cyclic byte rotationSubWord: apply the SubBytes S-box to each byteCracking block ciphers (for fun and profit).
What did we learn?
Ask now, catch me after class, or email eoin@eoin.ai
© 2026 Eoin O’Brien. All rights reserved.