Applied Cryptography

Image data were encrypted with AES in ECB mode, and the outline of the original picture could still be recognized in the encrypted image. Which of the following is the cause?

  1. AThe AES key was too short, so some blocks were left as they were without being encrypted
  2. BECB mode automatically generates a different key for each block, and the pattern of those keys appears in the encrypted image
  3. CIn ECB mode identical plaintext blocks always become identical ciphertext blocks, so the patterns of areas of the same color remain
Show answer and explanation

Answer: C. In ECB mode identical plaintext blocks always become identical ciphertext blocks, so the patterns of areas of the same color remain

ECB (electronic codebook) mode simply encrypts each block independently with the same key. So if the plaintext contains blocks with identical contents, identical blocks appear at the same positions in the ciphertext. In an image with long runs of the same color, such as a background, the information about where the same color is remains, and the example of an encrypted penguin image is well known. For this reason ECB mode is not used to encrypt general data; modes that produce a different ciphertext each time even from the same plaintext, such as CBC mode, CTR mode and GCM, are used instead.

  • A. AES encrypts every block regardless of key length. The problem is not the key length but a property of the mode.
  • B. ECB mode uses the same key for every block. No key appears in the image.
  • C. Correct. That identical plaintext blocks become identical ciphertext blocks is the weakness of ECB mode.
Practice this topic Back to topic

Books on Applied Cryptography Ad

As an Amazon Associate I earn from qualifying purchases.

More Applied Cryptography questions

  1. Which of the following is an appropriate way to handle the initialization vector (IV) when using AES in CBC mode?
  2. AES (block length 16 bytes) is used in CBC mode with PKCS#7 padding. In PKCS#7, if n bytes are missing, n bytes of value n are added, and even when the plaintext length is exactly a multiple of 16, 16 bytes of value 16 are added. Which of the following is the length of the ciphertext (not including the IV) when a 96-byte plaintext is encrypted?
  3. A server receiving data encrypted in CBC mode returned different errors when the padding after decryption was incorrect and when the padding was correct but the check of the contents failed. Which of the following correctly describes this situation?
  4. Which of the following correctly describes a feature of CTR mode (counter mode) of a block cipher?
  5. In CTR mode, two messages were mistakenly encrypted with the same key and the same nonce. For the byte at one position, the first plaintext P₁ is 01001000 (ASCII "H"), its ciphertext C₁ is 01110100 and the second ciphertext C₂ is 01010101. If the attacker knows P₁, which of the following is the second plaintext P₂ at the same position?

Comparisons in this topic