News for hackers. Stuff that matters.
Re:“Should you encrypt or compress first?” by hinkley on Tuesday June 28, 2016 @12:23PM (#11995039)
Does this really need to be said though?

I may be too close to the problem. I've had to explain this to project managers and customers of course, but this is hacker news.

It feels like a three page article on why you should put your socks on before your shoes and not after.

Re:“Should you encrypt or compress first?” by kaoD on Tuesday June 28, 2016 @01:18PM (#11995561)
> but this is hacker news.

So? There are too many domains to be familiar with. You just happen to be familiar with this one. I bet there are plenty things I'd consider obvious on many other domains where you'd be clueless.

Re:“Should you encrypt or compress first?” by mcguire on Tuesday June 28, 2016 @12:38PM (#11995205)
Once upon a time I was at a talk given by a visiting professor (associated, I think, with the Horus project[1]; I'm reasonably sure some of you would recognize the name if I could remember it) on designing network protocols using plug-n-play software components. The illustrations he showed used Lego bricks.

His big example was a Lego brick labelled "Compression" and another brick labelled "Encryption", and how you could arbitrarily compose them to achieve different protocols.

Meanwhile, I was sitting at the back of the room wearing my "I'm not a security guy, but this is garbage" look.

[1] http://www.cs.cornell.edu/info/projects/horus/main.html

Re:“Should you encrypt or compress first?” by tuatara on Wednesday June 29, 2016 @04:54PM (#12004734)
Perhaps you're referring to Prof. Ken Birman, inventor of Paxos and slayer of CAP? I could barely contain myself at his recent MesosCon keynote[1,2].

[1] https://mesosconna2016.sched.org/event/6ljt/keynote-a-real-t... [2] http://go.linuxfoundation.org/mesoscon-north-america-2016-vi...

Re:“Should you encrypt or compress first?” by yellowstuff on Tuesday June 28, 2016 @12:31PM (#11995132)
It's not just you. I've never used encryption or compression in any serious way, but the right answer seems obvious if you know the definitions of encryption and compression.
Re:“Should you encrypt or compress first?” by ghshephard on Tuesday June 28, 2016 @01:55PM (#11995912)
Really? I've been reading, and following encryption news for 10+ years, and it had never occurred to me that you should not compress prior to encrypting. The article was an eye opener for me - in hindsight, maybe obvious, but I bet 90% of your average technical audience wouldn't realize that you should not compress prior to encrypting.
Re:“Should you encrypt or compress first?” by hinkley on Tuesday June 28, 2016 @05:00PM (#11997528)
mea culpa.

I am guilty of not waiting around for him to get to his point 3/4 of the way through the article. If you're trying to bring up subtle issues, don't bury the lede.

What he's really trying to say is that you shouldn't compress sensitive data at all. And now we're into the non obvious stuff that some of us are clearly talking past each other about.

Personally, I think he's painting too broad a stroke and some domains don't have this problem, and for some there are other factors at play such as insufficient block size giving away too much information.

You could for instance probably figure out who is speaking just by the pattern of pauses, without even trying to decrypt what is said.

And then there's session cookies, which I despair of ever being secure. Because of the chosen plaintext of CRIME, even a large block size would only make the setup phase take a bit longer (finding a message that is one byte bigger than the block size). Encryption is insufficient to protect shared secrets.

Re:“Should you encrypt or compress first?” by vilhelm_s on Tuesday June 28, 2016 @11:23PM (#11999291)
It's considered obvious now, after the CRIME attack was published, but 15 years ago everyone would have said that you obviously should compress first! (I remember this being asked as a homework question when I was in college, with "compress first" being the intended answer.)

Indeed, I think the conventional wisdom was that compressing first would in fact improve security a little bit. This idea goes back all the way to Shannon in 1949, who noted that compressing before encrypting should improve information-theoretic security, because if the messages contain redundancy, then an adversary with infinite computing power can use that to decode the message. (Just try all possible keys, and see if it decrypts to an actual English sentence.) On the other hand, if you first compress using an ideal compressor, then every compressed plaintext will look the same (just random noise), so every possible encryption key will produce some plausible plaintext.

[1] http://netlab.cs.ucla.edu/wiki/files/shannon1949.pdf ; see sections 16 - 19.

Re:“Should you encrypt or compress first?” by danielweber on Tuesday June 28, 2016 @02:36PM (#11996281)
Even a few years ago, the "obvious answer" in the infosec space was that you should compress first.
Re:“Should you encrypt or compress first?” by hinkley on Tuesday June 28, 2016 @08:36PM (#11998701)
I think most of my upvotes are from people who only read half the article waiting for him to say something interesting and giving up. My grade schooler tells better stories.

As someone else said, the title is terrible. What we are left with in some scenarios is choosing one or the other, not one before the other.

Re:“Should you encrypt or compress first?” by PhasmaFelis on Tuesday June 28, 2016 @01:53PM (#11995898)
You were a newbie too, once. Some people read Hacker News precisely to learn things like this.
Re:“Should you encrypt or compress first?” by canttestthis on Tuesday June 28, 2016 @01:39PM (#11995774)
Cut the arrogance. It's not obvious to all of us, we're not all cryptonerds.
Re:“Should you encrypt or compress first?” by jessriedel on Tuesday June 28, 2016 @02:06PM (#11996037)
Arrogance is probably better than name calling.
Re:“Should you encrypt or compress first?” by hinkley on Tuesday June 28, 2016 @04:07PM (#11997095)
"Maybe I'm too close to the problem."