by phillmv on 6/28/16, 3:00 PM with 235 comments
by orlp on 6/28/16, 3:30 PM
It's just compress or not, before encrypting. If security is important, the answer to that is no, unless you're an expert and familiar with CRIME and related attacks.
Compression after encryption is useless, as there should be NO recognizable patterns to exploit after the encryption.
by vog on 6/28/16, 3:45 PM
There's an interesting article on that topic by Ted Unangst:
"preauthenticated decryption considered harmful"
http://www.tedunangst.com/flak/post/preauthenticated-decrypt...
EDIT: Although the article talks about encrypt+sign versus sign+encrypt, the same argument goes for compress+sign versus sign+compress. You shouldn't do anything with untrusted data before having checked the signature - neither uncompress nor decrypt nor anything else.
by mjevans on 6/28/16, 4:33 PM
* Always pad to combat plain-text attacks, padding in theory shouldn't compress well so there's no point making the compression less effective by processing it.
* Always compress a 'file' first to reduce entropy.
* Always pad-up a live stream, maybe this data is useful in some other way, but you want interactive messages to be of similar size.
* At some place in the above also include a recipient identifier; this should be counted as part of the overhead not part of the padding.
* The signature should be on everything above here (recipients, pad, compressed message, extra pad).
. It might be useful to include the recipients in the un-encrypted portion of the message, but there are also contexts where someone might choose otherwise; an interactive flow would assume both parties knew a key to communicate with each other on and is one such case.
* The pad, message, extra-pad, and signature /must/ be encrypted. The recipients /may/ be encrypted.
I did have to look up the sign / encrypt first question as I didn't have reason to think about it before. In general I've looked to experts in this field for existing solutions, such as OpenPGP (GnuPG being the main implementation). Getting this stuff right is DIFFICULT.
by Animats on 6/28/16, 10:44 PM
by dietrichepp on 6/29/16, 3:28 AM
In fact, if you successfully compress data after encryption, then the only logical conclusion is that you've found a flaw in the encryption algorithm.
by kinofcain on 6/28/16, 3:52 PM
https://http2.github.io/http2-spec/compression.html#Security
by js2 on 6/28/16, 5:00 PM
by tomp on 6/28/16, 3:21 PM
by arknave on 6/28/16, 4:36 PM
by jakozaur on 6/28/16, 3:59 PM
by IncRnd on 6/28/16, 6:11 PM
There may be compensating controls that invalidate the perceived needs for encryption or compression, for example. i.e. don't design in the dark.
Of course, the interviewer may just want a canned scripted answer - but the interview is your chance to shine, showing how you can discuss all the angles.
by spatulon on 6/28/16, 6:38 PM
https://www.nccgroup.trust/us/about-us/newsroom-and-events/b...
by biokoda on 6/28/16, 3:24 PM
by jayd16 on 6/28/16, 5:49 PM
Instead, when you submit something to the AppStore, you end up with a much bigger app than the one you uploaded.
To add insult to injury, if you ask Apple about this fuck up you get an esoteric support email about removing "contiguous zeros." As in, "make your app less compressible so it won't be obvious we're doing this wrong."
by poelzi on 6/28/16, 6:07 PM
by em3rgent0rdr on 6/28/16, 6:37 PM
by hueving on 6/28/16, 4:50 PM
by panic on 6/28/16, 3:55 PM
by Qantourisc on 6/28/16, 9:40 PM
by itsnotvalid on 6/29/16, 5:47 AM
I think it is best to use built-in compression scheme by the compression program to do the encryption first, as those often take these into account (and the header is not leaked, since only the content is encrypted).
by cm2187 on 6/28/16, 7:06 PM
by arielweisberg on 6/28/16, 3:32 PM
Is this kind of problem not already dealt with for me by the secure transport layer? It would be a shame if the abstraction were leaky. My understanding of the contract is that whatever bits I supply will be securely transported within the limits of the configuration I have selected.
If I pick a bad configuration then yes shame on me, but a good configuration won't care if I compress right?
by gravypod on 6/28/16, 3:24 PM
Compressing the source material will yield smaller results but will be more predictable as the file will always contain ZIP headers and other metadata that would possibly make decryption of your file much easier.
by jtolmar on 6/28/16, 5:34 PM
It seems like it should be, but I'm not an encryption expert. The compression should be pretty good, though.
by khc on 6/29/16, 1:41 AM
The technique to reconstructing speech clearly had its limitations.
by draugadrotten on 6/28/16, 3:32 PM
by gameofdrones on 6/28/16, 8:26 PM
by kstenerud on 6/28/16, 3:36 PM
by arjie on 6/28/16, 5:52 PM
by FuturePromise on 6/28/16, 5:30 PM
by justinzollars on 6/28/16, 4:05 PM
by vox_mollis on 6/28/16, 4:06 PM
by usloth_wandows on 6/28/16, 3:23 PM