I have a requirement stating that data compression and encryption should be performed.
However, I have doubts relating to which step should be performed first in order to optimize compression rate and execution time. How can I choose which step to perform first and the compression and encryption approach to use?
I would strongly expect an "encrypt then compress" approach to give you almost no compression. Encrypted data shouldn't have any discernable patterns in it, which is basically what compression relies on.
Compress then encrypt.
As for which kind of encryption and compression to use - that entirely depends on your context, which you haven't given any information about. Heck, you may find that your data isn't compressible in the first place.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With