I recently posed the question:
Should I compress and then encrypt, or vice-versa?
to the Super User community. Well, this seemingly simple question sparked quite a discussion, so I have collated all the comments and answers and come up with what I hope is a definitive answer, along with the why and wherefore of it all.
In order to not only answer this question, but also to understand the answer, we first need to know how both compression and encryption work.
Let’s start with compression.
We’ve all come across compression in some form or other, but actually compression and how does it work?
Well, the actual meaning of compression in the English language is:
… the result of the subjection of a material to compressive stress, which results in reduction of volume as compared to an uncompressed but otherwise identical state.
In other words, squashing something to make it smaller. And this can be applied to data as well as physical objects. No, data compression doesn’t mean physically pushing the magnetic particles in your hard drive closer together (though that would be a neat trick), but to change the data so it takes up less space but can still be interpreted in the same way.
more »