Exercise 1: Why the ECB Penguin Stays a Penguin — Possible Solution ==================================================================== A bitmap image is made up of many flat, uniformly-colored regions -- the sky, the penguin's white belly, its black back -- each of which corresponds to long runs of IDENTICAL or near-identical pixel data when the image is split into fixed-size blocks. Under ECB mode, each of those blocks is encrypted completely independently, using the same key and the same algorithm every time. Because ECB's defining property is that identical plaintext blocks always produce identical ciphertext blocks, every block belonging to one of those flat colored regions still encrypts to the SAME ciphertext value as every other block from that same region. The region's boundaries -- where the pattern changes from one repeated block value to another -- are still visible in the ciphertext, in exactly the same positions they occupied in the plaintext. Nothing about ECB mode scrambles the LAYOUT of the image, only the specific byte values within each block. Connection to Chapter 2's monoalphabetic substitution: This is exactly the same failure mode as monoalphabetic substitution, just operating on 128-bit blocks instead of single letters. A monoalphabetic cipher maps every occurrence of a given plaintext LETTER to the same ciphertext letter every time, which is what let frequency analysis recover the mapping in Chapter 2. ECB mode maps every occurrence of a given plaintext BLOCK to the same ciphertext block every time -- a fixed mapping at a larger granularity, but the identical underlying flaw: any repetition or structure in the plaintext survives, unchanged in shape, into the ciphertext. WHY THIS WORKS AS AN ANSWER ------------------------------ The chapter states this connection directly ("structurally the exact same weakness Chapter 2 spent an entire chapter exploiting... a fixed mapping... always leaks the structure of whatever it's applied to"). This answer makes that connection concrete by tracing exactly how a flat-colored image region becomes a sequence of identical plaintext blocks, and why AES's own strength as a cipher (Chapter 5) is completely irrelevant to this specific failure -- the weakness is entirely in the MODE, not the cipher.