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.encopenssl enc has no GCM mode, so the lesson uses -aes-256-cbc as a stand-inRelated terms
- block cipher mode — The method for using a block cipher such as AES on data longer than one block, such as CBC or GCM.
- initialization vector — A random or unique value fed into encryption with the key, so the same plaintext encrypts differently each time.
- AES-GCM — AES in Galois/Counter Mode: the most widely used way to encrypt data so that it stays secret and any tampering is detected.
- ECB mode — Electronic codebook mode: the simplest way to use a block cipher, which encrypts every block separately and so leaks patterns in the data.
Taught in
- Data States: Security at Rest, in Transit, and in Use — Cybersecurity Fundamentals, GRC & Cryptography