Cipher Block Chaining (CBC)

Security+ ๐Ÿ† โ€ข Cryptography ๐Ÿ”’ โ€ข Difficulty: premium

Definition

Cipher Block Chaining is a block-cipher mode that links blocks together: each plaintext block is XORed with the previous ciphertext block before encryption. A fresh, unpredictable IV starts the chain so identical plaintext blocks encrypt differently.

Examples

  • File encryption with AES-CBC where each file uses a new 16-byte random IV stored alongside the ciphertext, plus a separate HMAC to detect tampering.
  • Older TLS 1.0/1.2 suites using AES-CBC to protect records (many environments now prefer AEAD modes instead).

Discover ๐Ÿ”Ž

CBC turns a block cipher like AES into a scheme that hides patterns. Instead of encrypting each block independently, it mixes every plaintext block with the previous ciphertext block so repeats donโ€™t show through. One unpredictable initialization vector (IV) kicks off the first block so two identical messages wonโ€™t start with the same ciphertext.

Open the interactive lesson Browse more topics

Tip: The interactive version includes progress tracking, decks, and premium deep dives.