According to docs you can use -z and --compress-level etc but does not specify if you omit -z or other ...-level params if it still compresses.



If compression-use can be specified by the --compress-algo name option and the default is to 'ZIP'. The default compression level is '6':

--compress-algo n Use compress algorithm n.

Default is 2 which is RFC1950 compression. You may use 1 to use the old zlib version (RFC1951) which is used by PGP. The default algorithm may give better results because the window size is not limited to 8K. If this is not used the OpenPGP behavior is used, i.e. the compression algorithm is selected from the preferences; note, that this can't be done if you do not encrypt the data.

You might also want to read http://www.ietf.org/rfc/rfc4880.txt to get an idea of what GPG actually does (point 2.3 and 9.3 describe compression).

  • 7
    by using --compress-algo 0 or --compress-algo none. why would you want to not use compression, btw? – akira May 22 '12 at 6:57
  • 3
    when the goal is to encrypt only, not to compress (e.g. for performance improvements or when the encrypted data is already compressed) – Alex May 22 '12 at 7:07
  • 2
    just tested --compress-also none works (actually -z 0 also works, at the time I did not test properly) – Alex May 22 '12 at 7:13
  • 5
    How can known, standardized compression algorithms reduce predictability? The content is unknown in both cases, as it is encrypted. If you know the kind of encrypted content, you still know that for an applied compression algorithm as well. – Thorsten Schöning Apr 7 '17 at 12:48
  • 3
    @ThorstenSchöning compression increases local entropy. en.wikibooks.org/wiki/Data_Compression/Order/Entropy - For example, an HTML page has a lot of predictable and recurring content, as do XML document formats. This helps attackers. Compression is a partial remedy for this. – foo Nov 22 '17 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.