What is use of Initialization Vector in cipher? Initialization vector is being used in all the ciphers. What is the need of this initialization vector. Are we using standard initialization vector for each cipher or a user can define it.
$\begingroup$ Related: What is the main difference between a key, an IV and a nonce? $\endgroup$– Ilmari KaronenNov 29, 2016 at 18:46
$\begingroup$ Since “how does an initialization vector work?” was handled as a duplicate, and this question asks the same, I’m marking this as a dupe as well. Besides that, it should be noted that “Difference between a nonce and IV” also explains what an IV is. $\endgroup$– e-sushiNov 29, 2016 at 19:23
What is use of Initialization Vector in cipher?
The initialization vector is mainly used to make sure that the ciphertext is different even if (parts of) the plaintext are identical. This is required as a modern cipher is supposed to be IND_CPA secure.
That is: the ciphertext should be indistinguishable from random even if the adversary provides the plaintext. If the adversary would provide two times "yes" as plaintext the ciphertext would be identical if the same key is used, obviously breaking the principle.
Furthermore, the IV may also be required to provide specific security for particular modes of operation. For instance, CBC mode of operation requires an IV that is not predictable by the adversary.
Are we using standard initialization vector for each cipher or a user can define it?
We cannot use a standard initialization vector; it has at least to be unique. The sender can define it yes. It doesn't need to be confidential.
Initialization vector is being used in all the ciphers.
ECB mode does not require an IV, but ECB mode is usually not considered secure for the reasons provided above.
Note that IND_CPA (indistinguishability under chosen plaintext attack) level security is not always required. For instance, under specific conditions ECB could be used for wrapping a fully random key.
Also note that this answer handles modes of operation for ciphers. Asymmetric primitives - where the ciphertext can be larger than the plaintext - often uses random numbers as input to provide the same IND_CPA security.