Compression used in an encrypted message

David Shaw dshaw at
Fri Mar 11 19:35:19 CET 2011

On Mar 11, 2011, at 12:50 PM, Avi wrote:

> Forgive my ignorance, but is there a way to take a given
> encrypted message/file and determine which compression algorithm
> was used (and which level)? I know how to set compression
> algorithm and level prefs, but I'm curious to see what others
> use, if possible.

You can't tell which compression is used in any arbitrary message since you need to be able to decrypt it first.  If the message is to you, however, you can run 'gpg --list-packets' on it.

When running list-packets, you should see a line like this:

   :compressed packet: algo=2

Algo 1 == ZIP
Algo 2 == ZLIB
Algo 3 == BZIP2

If there is no "compressed packet" line at all, then the message is uncompressed.


More information about the Gnupg-users mailing list