1

If I encrypt a 1MiB file with AES-CBC (or any other cipher) and XOR a 128KiB of (truly) unpredictable random data repeating until the end of file, will I have a security of 1048576-bits (128KiB*8)?

This question is a little weird, but I would like to know if this scheme has a security flaw (maybe known-plaintext attacks).

phantomcraft
  • 887
  • 6
  • 14

1 Answers1

2

This will be only as secure as AES-CBC, as the repeating XOR you're describing is massively vulnerable to a myriad of attacks, including known-plaintext attacks. Also remember that you could "cancel out" the 128 KiB by XORing two blocks together, since $P_1 \oplus K \oplus P_2 \oplus K = P_1 \oplus P_2$.

Don't try to chase large key sizes. 256 bits of key material is more than enough.

forest
  • 15,626
  • 2
  • 49
  • 103