I have been reading to understand the need to randomise the IV but have failed to understand this yet.

Could someone please explain why do we need to randomise the IV if we somehow need to send the IV with the cipher text because the receiver, even though has the key would not know the random IV.

Therefore, wouldn't an adversary who has access to the cipher text can see the random IV for each message?

Why isn't it better to agree on a fixed IV like the key and not send it over with the cipher text?

  • 1
    $\begingroup$ I suggest that you look at the top answer to crypto.stackexchange.com/questions/2173/… ; it answers all the questions you are asking. In particular: 1 - there is no need to make the IV secret from an adversary, so the encryptor can send it in clear along the encrypted message, 2 - in some cases (e.g. CBC mode) the IV needs to be unpredictable, but not always (e.g. CTR mode), 3 - fixed IVs generally result in catastrophic failures. $\endgroup$ Oct 28, 2016 at 11:18
  • $\begingroup$ I have already read it. while a great source, it only explains the usual why not to reuse IV and how not to reuse IV. I am struggling to get the answer to my question. $\endgroup$
    – Menol
    Oct 28, 2016 at 12:07
  • $\begingroup$ The IV isn't secret. Knowing it doesn't help attacks. $\endgroup$
    – SEJPM
    Oct 28, 2016 at 12:22
  • $\begingroup$ thanks but that has already been very clear. could you answer my question? $\endgroup$
    – Menol
    Oct 28, 2016 at 12:33

1 Answer 1


Randomizing the IV makes it so that you can send the same plaintext twice, and still get different ciphertext. If you don't do that, an adversary will be able to tell whether or not two messages are identical. This can provide a way for an adversary to infer the contents of messages without actually directly attacking the cipher.

A randomized IV prevents this, even though the IV itself is typically made public, since there's no way an attacker can use the transmitted IV to decipher the message without also knowing the key.

It's a lot like salting passwords, really.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.