Score:1

Encrypting with CBC then XORing repeatedly a chunk of random data smaller than the plaintext: Is there a gain in security?

pf flag

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).

Score:2
vn flag

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.

phantomcraft avatar
pf flag
Yes, I was trying to chase large key sizes, pardon me. =)
forest avatar
vn flag
@phantomcraft There's really no need to do that. 256 bits is plenty, although you can use XTS to get a little more strength for "free" (384 bits when you take into account meet-in-the-middle).
phantomcraft avatar
pf flag
In a quantum scenario I would get 192-bits with AES-256-XTS, am I right?
forest avatar
vn flag
@phantomcraft Well, sort of, but see https://crypto.stackexchange.com/a/102672/54184. While it would reduce it to 192 bits, quantum computers simply don't scale when running Grover's algorithm. Even 256 bits (thus 128 vs Grover's) is _more_ than enough.
phantomcraft avatar
pf flag
I was thinking that quantum computers could reduce AES-256-XTS to 128-bits. That's why I asked. I know, my PC is AES-256-XTS encrypted.
forest avatar
vn flag
They can, but $2^{128}$ quantum operations is _way_ more difficult to achieve than $2^{128}$ classical operations.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.