A mode of operation defines how a block cipher encrypts or decrypts data larger than one block. AES processes fixed 16-byte blocks, so a longer message must be divided, padded when necessary, and processed according to a mode. section 5.2
ECB encrypts each block independently, making repeated plaintext produce repeated ciphertext. That visible pattern can reveal structure and let an attacker substitute known ciphertext without cracking the key. Never use ECB. section 5.2
Repeated HTTP responses
If an encrypted HTTP response repeatedly begins with the 16-byte block “HTTP/1.1 200 OK” plus a newline, ECB produces the same ciphertext block each time. An observer can identify that pattern and manipulate responses by substitution. section 5.2
CBC chains each plaintext block with the previous ciphertext block, hiding repeated patterns. It requires a secret key and a random, one-time IV; the IV may be stored openly, but must not be reused with that key. CBC provides confidentiality only, not integrity or authenticity. section 5.2.1 section 5.7
For new AES encryption, prefer authenticated encryption such as GCM. It combines confidentiality, integrity, and authenticity, using a secret key and random IV to produce ciphertext with an authentication tag that detects tampering. section 5.7
Figure 5.3 ECB mode encrypts each input block independently using the secret key and concatenates the resulting ciphertext. ECB mode is simple but insecure; never use it.
Compare independent ECB blocks with safer chained processing and see why repeated ciphertext exposes plaintext patterns. section 5.2

