Is it better to encrypt a message and then compress it or the other way around? Which provides more security?
I have the assumption there is no added protection at all. There is no difference in the security provided, but because of the way compression algorithms work, you are probably going to get better compression if you compress first then encrypt. Compression algorithms exploit statistical redundancies (such as those that exist in natural language or in many file formats) in the data which should be eliminated when you encrypt it, therefore an encrypted message shouldn't be able to be compressed all that well. From the wikipedia article : However, lossless data compression algorithms will always