CBC mode

Cipher block chaining, a way of running a block cipher in which each block of plaintext is mixed with the previous block of ciphertext before it is encrypted.

In more detail

Chaining means identical plaintext blocks produce different ciphertext, fixing the obvious pattern leak of ECB mode, and the first block is mixed with a random, unpredictable initialisation vector. On its own it gives confidentiality but no integrity: an attacker can flip bits in the ciphertext, and careless handling of padding errors has led to padding oracle attacks that recover the plaintext. New designs prefer authenticated modes such as AES-GCM, or pair this mode with a separate message authentication code.

Examples

openssl enc -aes-256-cbc -pbkdf2 -pass file:db.key -in customers.db -out customers.db.enc
openssl enc has no GCM mode, so the lesson uses -aes-256-cbc as a stand-in

Related terms

Taught in

References