compression and encryption

Adrian 'Dagurashibanipal' von Bidder
Wed Jan 22 16:48:02 2003

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Mit, 2003-01-22 at 16:35, Michael Anckaert wrote:
> Hello all,
> is it possible to encrypt a tar archive and then bzip2 it, or will this
> cause problems?

It won't cause any problems (apart from tar not being able to deal with
it, but I guess you knew that). But it won't compress it: compression
needs redundancy in the data - and redundancy in encrypted data
basically means that the encryption algorithm is bad. And, as we all
hope, gpg uses good encryption algorithms.

In other words: any data compression must come before encryption to gain
anything. gpg usually compresses data anyway before encrypting it, so
you could try how good you get without explicit compression.

NOTE: this is of course only if you don't use ascii armored output. The
ascii armored output can of course be compressed again, but I don't
think it makes sense, better just use binary gpg output.

-- vbi

get my gpg key here:

Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

Version: GnuPG v1.2.1 (GNU/Linux)
Comment: get my key from

Signature policy: