0
I read this blog which explains why this isn't possible but I can't seem to figure out the reason. I find the blog a little difficult to understand.
Can someone please explain why it's not possible to compress and encrypt the same folder or file ? A simple example would really go a long way in understanding the reasoning behind this.
Does encrypting a compressed file/folder increase it's size and hence defeat the purpose of compression ?
Similarly, does compressing an encrypted file/folder compromise the security of the file ?
If yes, how ?
Compression is form of security? Did not know. – Griffin – 2015-05-28T16:25:43.627
1Compression is definitely not encryption. The compressed file is self-contained and can be unpacked without additional knowledge. Encryption, on the other hand, provides security by requiring additional information to derive a key. – Daniel B – 2015-05-28T16:28:18.077
@DanielB Compression by definition is encryption. If you were to compress a text file, would it read just like the original? No. It itsnt necessarily secure encryption, but most definitely is encryption. – Keltari – 2015-05-28T16:30:59.633
1@Keltari "In cryptography, encryption is the process of encoding messages or information in such a way that only authorized parties can read it." (from wiki) Compression does nothing to restrict access to authorized parties, and therefore is not encryption. Encoding, perhaps, but not encryption. – Darth Android – 2015-05-28T16:33:12.833
@DarthAndroid It depends on your definition of encryption. There are plenty of resources out there that call compression a form of encryption. – Keltari – 2015-05-28T16:38:32.280
@Keltari I was being sincere in my comment. I assumed you were right. In googling however I found otherwise. I wasn't trying to come off as a smartass. – Griffin – 2015-05-28T16:45:12.147
I would say that compression is a form of encoding which is one way to look at encryption. In my mind it is a naive way to look at it and at best is comparable to considering obfuscation to be effective security. Which of course it isn't. – EBGreen – 2015-05-28T16:47:22.110
Okay so the great ruler that is Wikipedia says "In cryptography, encryption is the process of encoding messages or information in such a way that only authorized parties can read it" Now compression is "In digital signal processing, data compression, source coding, or bit-rate reduction involves encoding information using fewer bits than the original representation" – Griffin – 2015-05-28T16:54:06.237
Encoding points to code which says "In communications and information processing, code is system of rules to convert information—such as a letter, word, sound, image, or gesture—into another, sometimes shortened or secret, form or representation for communication through a channel or storage in a medium." In the case of compression I think it's safe to say that the purpose is to shorten the message. – Griffin – 2015-05-28T16:55:32.113
How about JPEG compression? Now if you have to use "compression" to secure data maybe you can e.g. use a secret-key to initialize a known compression algorithm. Theoretically compression will create an entropy (i.e. information density) of 1 and encryption an entropy of 0 bits of information / physical bit. Therefore your compressed file would only be encrypted if all the information is contained in the secret-key and the compressed file becomes 0 bytes long. If not you have stored information in the data that the compressor generates. This shows that compression is not encryption. – Wouter – 2016-06-05T15:41:15.107