Page MenuHome GnuPG

opaque default compression parameters
Closed, ResolvedPublic

Description

There is the file with an english text as large as 380K.
$ ls -s /tmp/file.txt
380 /tmp/file.txt

I suppose that deflate should make the text file smaller:
$ ls -s /tmp/file.txt.zip
144 /tmp/file.txt.zip
Yes, that is.

I'm encrypting some text without compression in such a manner:
$ gpg2 --encrypt --armor /tmp/file.txt

and have 196K base64 file:

$ ls -s /tmp/file.asc
196 /tmp/file.txt.asc

After the compression I get much bigger file:

$ gpg2 --compress-algo ZIP -z 9 --encrypt --armor /tmp/file.txt
$ ls -s /tmp/file.txt.asc
208 /tmp/file.txt.asc

So, I've concluded that compression doesn't work.

Details

Version
1.5.3

Event Timeline

terry added projects: Feature Request, gnupg.
terry added a subscriber: terry.
terry raised the priority of this task from Wishlist to Low.Jul 14 2015, 8:12 PM
terry added a project: Bug Report.
terry removed a project: Feature Request.

I'm not sure that 208k is much bigger than 196k. What is likely going on is
that gpg is using different compression parameters from zip.

neal claimed this task.

Also, compression will likely be removed from future versions of OpenPGP (RFC
4880 bis). There are three justifications. Removing compression simplifies
packet processing, which is good for security. OpenPGP is an encryption
standard not a compression standard and not including it doesn't preclude the
user from compressing the data anyway. It's a security risk, because
"compression provides an oracle for the plaintext" (see [1] and [2]).

[1] http://cryptopals.com/sets/7/challenges/51/
[2] https://www.ietf.org/mail-archive/web/openpgp/current/msg07718.html

terry renamed this task from compression doesn't work to opaque default compression parameters.Jul 16 2015, 8:08 PM