3 ms·
I think it's really sad that we have to use sub-par compression because we can't trust TLS to keep our data secure when we use good compression, since TLS leaks
by londons_explore 8y ago
I think it's really sad that we have to use sub-par compression because we can't trust TLS to keep our data secure when we use good compression, since TLS leaks the compressed size to attackers, and when compressed, the size can depend on the content.
I don't have a solution to that issue, but it seems really fundamental, and something we should all be on the lookout for ways to solve.
- cipherboy 8y agoThis is an issue with compression not TLS. The threat model is this: the Mallory controls some number of bytes in a web page. Can she exfiltrate data about Alice's session (e.g., bank account number) by only knowing the size of the compressed payload and modifying her portion of the content? For this purpose, TLS is a fixed-sized modification: |TLS(m)| = |m| + k for a constant k. So it doesn't meaningfully impact this attack: you can do it with just compression and no encryption. Compression is useful when the cost of sending bytes exceeds the cost to decompress. If you start padding compression back to the original payload length, you no benefit to compressing in the first place. If instead you introduce a random amount of padding, this adds overhead both to decompression and in transfer, at a marginal benefit to security (the attacker needs more requests -- either to recover a larger portion of the secret's context, or to control for the random noise). This is also a cryptopals exercise: https://cryptopals.com/sets/7/challenges/51 https://cryptopals.com/sets/7/challenges/51
- tialaramex 8y ago> I don't have a solution to that issue You don't have a solution because there isn't a solution. It's your definition of "good compression" which is leaking the data, not TLS, if you're willing to let Bill guess what your phone number is, while you agree to just tell him which digits he gets wrong, Bill can guess your phone number in no more than ten tries (the tenth will be correct if none of the others were). TLS doesn't actually leak the compressed size, it's just that in practice you will stop the TLS session after transmitting the compressed data, because to do otherwise is wasteful and if you didn't care about waste you would not use compression. If you want, you can run TLS with padding to always hit, say, a multiple of 4 kilobytes per transaction. Now say your "compression" took you from 3.84kB to 2.16kB and then you padded it to 4kB anyway and oh, wait, this was worse, why did we bother with compression? If you have a system with an explicit range of sizes and can tolerate always transmitting the maximum size, TLS absolutely will mask out the actual size with padding.
- blattimwind 8y agoThis is not a problem with TLS. This is a problem with encrypting information of different contexts together. In other words, this is a problem of HTTP and the web. It is also a problem of people thinking that you can have a magic encrypted pipe from A to B (e.g. TLS) that protects your information perfectly no matter how negligent you are: It's a wrong idea about an abstraction.