I understand the IV should be random and XORed with the plain text to start the encryption. My question is, in addition to the key, do I have to remember the random IV as well for decryption?
Asked
Active
Viewed 3,002 times
-1
-
No, you do not xor the iv with the plain text, it is simple passed to the encryption function. – zaph Aug 13 '16 at 16:11
-
I'm voting to close this question as off-topic because it belongs on cryptography SE. – erickson Aug 15 '16 at 15:32
1 Answers
4
The IV needs to be random, but does not need to be secret. Usual practice is to prepend the IV to the cyphertext before transmitting it. When decrypting, use the first 16 bytes of the cyphertext as the IV to decrypt the remainder. That way you do not have to store it separately, as it is included in the cyphertext.

rossum
- 15,344
- 1
- 24
- 38