http://www.perlmonks.org?node_id=602009


in reply to Customer data encryption

Also, do I need to encrypt and then compress, or compress and then encrypt?

If you want the compression to actually compress the data you must compress first. If you encrypt the data it should make the data look random, there will be no patterns (for any reasonable algorithm). Compression algorithms rely on patterns to reduce the size of the data. So, if you compress first, you get the benefit of the compression, if you encrypt first, it may actually increase the size of the final output. Corrected