Applied Cryptography

Which of the following is an appropriate way to handle the initialization vector (IV) when using AES in CBC mode?

  1. AKeep the IV secret like the key and keep using the same value for every message
  2. BThe IV need not be secret, but choose a new random value for each message that an attacker cannot predict
  3. CThe IV need not be secret, and it may be fixed to the same value agreed with the other party (for example all zeros) every time
Show answer and explanation

Answer: B. The IV need not be secret, but choose a new random value for each message that an attacker cannot predict

In CBC mode each plaintext block is XORed with the previous ciphertext block before being encrypted, and the first block is XORed with the IV. The IV is usually sent at the beginning of the ciphertext, so it need not be kept secret. However, if the same IV is used every time, messages that begin the same way also produce ciphertexts that begin the same way, revealing that parts of the contents are identical. Furthermore, if an attacker can predict the next IV, attacks are known that guess contents by having chosen plaintexts encrypted (such as the BEAST attack on TLS 1.0).

  • A. The IV is normally sent together with the ciphertext and need not be secret. Reusing the same value lets messages that begin the same way be recognized.
  • B. Correct. The IV in CBC mode is an unpredictable value for each message.
  • C. With a fixed IV the same plaintext always gives the same ciphertext, creating a weakness close to that 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. 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?
  2. 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?
  3. Which of the following correctly describes a feature of CTR mode (counter mode) of a block cipher?
  4. 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?
  5. Which of the following does authenticated encryption (AEAD) such as AES-GCM provide in a single operation?

Comparisons in this topic