Electronic Codebook (ECB) mode encrypts each plaintext block independently with the same secret key, then concatenates the ciphertext blocks. Because encryption is deterministic, repeated plaintext blocks produce repeated ciphertext blocks and reveal patterns. ECB is part of the AES standard but should never be used in applications. section 5.2
Repeated HTTP responses
If ECB encrypts HTTP responses, repeated blocks such as “HTTP/1.1 200 OK” produce identical ciphertext. An attacker can recognize and substitute that ciphertext pattern, changing the apparent response without cracking the key. section 5.2
Use these practical rules:
- Never use ECB for application encryption. section 5.2
- Prefer authenticated encryption such as AES-GCM, which provides confidentiality, integrity, and authenticity. 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.
Visualizes independent block encryption, ciphertext concatenation, and the resulting security weakness. section 5.2


