Skip to main content

Block Ciphers

A symmetric encryption algorithm that encrypts data in set chunks, with varying chunk sizes.

Common sizes range from 64, 128, and 256 bits of length. Notice something? Something about all of them being powers of 2? You know, $2^6$, $2^7$, and $2^8$? When the data doesn't fit into the set block size, random bits are used to fill in the remaining space.

There are six modes of operation when using block ciphers.

Operation Mode
Description
Electronic Code Book (ECB)The simplest mode. Each block of plaintext is encrypted separately. However, blocks with identical data will generate the same ciphertext.
Cipher Block Chaining (CBC)Uses an initialization vector (IV), which is a random starting variable that's XORed with the plaintext of the current block to begin the encryption chain. The IV for the next block is the ciphertext of the previous block.
Cipher Feedback Mode (CFB)Also uses an IV, but encrypts it first before applying to the beginning block. It's the equivalent of using a OTP