3 ms·
I suppose that adding a small random bit into the page could defeat this known-plaintext attack?
by nine_k 12y ago
I suppose that adding a small random bit into the page could defeat this known-plaintext attack?
- strommen 12y agoNot really. The theory behind the attack is that if the user-specified content is equal to the secret content, it will compress more effectively and have a smaller content length. The other content on the page doesn't really matter. Adding data of random length will make the attack more difficult, but won't defeat it entirely. This is called length hiding. See http://breachattack.com/ http://breachattack.com/ for a more thorough explanation by smarter people.
- nine_k 12y agoThe attack depends on a secret to match a user-provided string enough for the compression algorithm to notice this redundancy? A counter-measure then would be to scramble the user input in the page with a random key, and include this key into the page for de-scrambling using JavaScript. It will still efficiently compress the parts of the page which are not user-controlled.
- nickysielicki 12y ago> de-scrambling using JavaScript No thank you.
- strommen 12y agoYes and Yes (assuming your random key isn't guessable). breachattack.com suggests masking the secret with a per-request random key, but masking the user input would work too.