On Thu, 22 Sep 2005 16:54:12 EDT, michael chang said:
> On 9/22/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > 2) Even though most modern block ciphers are designed to be fast, it's still
> > faster to apply a reasonably quick compression scheme to whomp 16K of data
> > down to 5-6K and encrypt/decrypt 5-6k than it is to encrypt/decrypt 16K.
> 
> Two questions.  One, does this mean that compression will usually be
> performed before encryption (which to me, sounds like it appears to be
> what would be the best method here)?

Yes, the general rule is "compress, then encrypt" and "Decrypt then decompress".

The corner cases where it should be the other way around are so few and far
between that it's not worth worrying about - they basically center around those
few times when compression causes a *larger* payload, and can be dealt with
a simple "Don't compress if output is bigger than input" rule.

Attachment: pgpRncQZOEsYN.pgp
Description: PGP signature

Reply via email to