-1

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?

4

1 回答 1

4

IV 需要是随机的,但不需要是秘密的。通常的做法是在传输之前将 IV 预先添加到密文中。解密时,使用密文的前 16 个字节作为 IV 来解密其余部分。这样您就不必单独存储它,因为它包含在密文中。

于 2016-08-13T15:49:02.057 回答