I am encrypting some publicly known data, and some private data using the same key, using AES256 with CBC.
An attacker does not have the ability to choose what the public data is.
Is this safe? (It looks to be, according to: Why is AES resistant to known-plaintext attacks?)
Assume I encrypt 4096_zeros.plain (public data) and my_private_data.plain with the same key and iv, producing 4096_zeros.crypt and my_private_data.crypt.
Is it possible for an attacker to use 4096_zeros.crypt to speed up either:
- the decryption of my_private_data.crypt, or
- the recovery of the key and iv.
Is using (and storing) a different iv for each file sufficient? (Am I correct in thinking that I'd need to store the iv with the encrypted data?)
If not, would adding 32 random bytes to the start of each file (which would be ignored after decrypting) be sufficient?