0

Odd situation, and I won't go into details about why our present circumstances require it. But, I'm looking for a way to force gpg to use compression. My testing is suggesting that the following command ignores the '-z' option:

gpg -z 6 -e test.zip

Note that the object to be encrypted is a zip archive. I'm using the bouncycastle java library to crack open output blob and it doesn't appear to be using pgp-compression.

My suspicion is that gpg detects that the file to be encrypted is already compressed and doesn't re-compress it. Unfortunately that's precisely what I need it to do.

Can anyone confirm this is the case (gpg doesn't re-compress)? And if so, is there a way to force it? Thanks.

3
  • Why would you want to compress an already compressed file. The results may result in a file significantly larger than the original!
    – mdpc
    Jul 17, 2013 at 19:06
  • Agreed - it is a silly thing to need. But I need it :)
    – pedorro
    Jul 17, 2013 at 19:15
  • 1
    Using -v with your command shows your suggest is right; neither the man page nor the esoteric options manual know anything about enforcing compression of compressed contents. Probably you're out of luck.
    – Jens Erat
    Jul 17, 2013 at 19:23

1 Answer 1

3

If you look at the relevant source file (encode.c; search for is_file_compressed), GPG will still do the compression if MDC is disabled. So passing --disable-mdc should do the trick.

If you don't want to disable MDC, then you should probably compile your own copy of GPG with the compression check removed.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .