Block Ciphers: CBC

The CBC (Cipher Block Chaining) mode solves this issue of ECB: it uses the ciphertext of the current block to encrypt the next block, making blocks depend on one another (a.k.a., "chaining" them) and, thereby, eliminates pattern recognition!

Encryption using the Cipher Block Chaining (CBC) mode.

Encryption using the Cipher Block Chaining (CBC) mode. WhiteTimberwolf (SVG version), Public domain, via Wikimedia Commons.

Decryption using the Cipher Block Chaining (CBC) mode.

Decryption using the Cipher Block Chaining (CBC) mode. WhiteTimberwolf (SVG version), Public domain, via Wikimedia Commons