liveBook · Manning

Mode of operation

As explained in Real-World Cryptography

A mode of operation is a method for applying a block cipher repeatedly to data blocks to encrypt messages of varying length.

A block cipher encrypts one fixed-size block at a time. A mode of operation describes how to apply it repeatedly to a longer message, while padding makes the final block fit. With AES, blocks are 16 bytes. section 4.3

The basic choices expose an important warning:

  • ECB encrypts each block independently. Because encryption is deterministic, repeated plaintext blocks produce repeated ciphertext blocks and can reveal patterns. section 4.3
  • PKCS#7 padding fills the final block with bytes whose value equals the padding length; a complete block receives a full block of padding. section 4.3

The encrypted penguin

Encrypting an image with ECB can leave the penguin recognizable because repeated regions remain repeated in the ciphertext. The ciphertext is encrypted, but its structure still leaks clues about the original.

How Real-World Cryptography covers it

How deep it goes
Defines padding, ECB, and CBC with short operational explanations, but stops short of detailed mode internals.
Examples
Uses a 16-byte AES block, an eight-byte padding illustration, and the recognizable ECB penguin image.
What it assumes
Assumes familiarity with AES block encryption while introducing padding and modes for practical message encryption.
What you can do after
Evaluate how padding and mode selection affect long-message encryption and recognize ECB pattern leakage.
How it connects
Connects block ciphers with AES, padding, PKCS#7, initialization vectors, ECB, and CBC.

Also explained in

Compare how 2 books explain mode of operation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Real-World Cryptography. The section links point to the parts of the book it draws on.