Skip to content

ECB leaks the picture

Level: 201 · working knowledge

Stub — an outline, not a lesson. There is no runnable example behind this page yet, so nothing on it has been through the check that backs every other claim in this library. The bullets below are the questions the finished page has to answer.

One line: The most-reproduced image in cryptography: a bitmap encrypted with AES-ECB, in which you can still see what it is a picture of.

The questions this page has to answer

  • Why does encrypting each block independently preserve structure?
  • Reproduce the penguin — with openssl enc -aes-128-ecb over a PPM's pixel data, keeping the header intact.
  • What real data has that much repetition? (Database columns, fixed-format records, an SAP IDoc.)
  • Does ECB ever leak content rather than shape? (Yes — equal blocks are visibly equal, which is a decryption oracle for low-entropy fields.)
  • Why is ECB still the default in some enterprise APIs?

See also