If your encryption algorithm is good (and AES with the correct chaining mode), then no compressor can compress the encrypted text. Or, if you prefer it the other way around: if you manage to compress some encrypted text, then it is time to question the quality of the encryption algorithm ...
This is because the output of the encryption system must be indistinguishable from purely random data, even from a specific attacker. The compressor is not a malicious attacker, but it works by trying to find nonrandom patterns that it can represent with fewer bits. The compressor cannot find such a pattern in ciphertext.
So, you must first compress the data, and then encrypt the result, and not vice versa. This is what is done in the OpenPGP format.
Thomas Pornin Jan 13 '11 at 13:56
source share