A Bluffer’s Guide To AES Modes … ECB, CBC, CFB, and all that jazz!
Published in
2 min readApr 19, 2022
Well, in its core form AES is a block cipher, but increasingly it is converted into a stream cipher in order to speed things up. For AES, the main things you need to know are:
- The block size. The block size is typically either 128 bits (16 bytes) or one bit. With a 16-byte block size, we have a block cipher, and for a one-bit block size we have a stream cipher.
- The key size. For the key size, we either have 128 bits, 192 bits or 256 bits.
- The IV (Initialization Vector). With the IV (otherwise known as a salt value), we protect against the same plaintext linking to the same ciphertext. There are many options we can use, but basically, Bob and Alice will use the same encryption key on either side.
So let’s quickly do a quick analysis of the different modes we can get for AES:
- ECB (Electronic Code Book). This no salt, and should never be seen. With this, the same plaintext will be mapped to the same ciphertext, for the same encryption key. More details here.
- CBC (Cipher Block Chain): A proper block cipher mode, and where each block chains…