Encrypting each block independently can preserve visible patterns, as the ECB penguin demonstrates. Cipher block chaining (CBC) hides those repetitions by combining each plaintext block with an unpredictable value before encryption. section 4.3
CBC encryption follows a short chain:
- Generate a random, unpredictable initialization vector (IV), 16 bytes for AES. section 4.3
- XOR the IV with the first plaintext block, then encrypt the result. section 4.3
- XOR each later plaintext block with the preceding ciphertext block before encrypting it. section 4.3
- Transmit the IV in clear text with the ciphertext so decryption can reverse the process. section 4.3
The ECB penguin
An image encrypted with ECB still reveals its outline because repeated plaintext blocks produce repeated ciphertext blocks. CBC uses a random IV and chained ciphertext blocks to produce different ciphertext for repeated plaintext encrypted separately. section 4.3


