Mismatch between binary and ASCII-armored output for encrypted message

Sven Radde email at sven-radde.de
Wed Sep 30 22:43:56 CEST 2009


Chris Sutton schrieb:
> What doesn't work
> -----------------
> I was under the impression that exactly the same process should work for
> a message encrypted using GPG. I pass in a plaintext file with the -e
> and -r options, and generate the binary and ASCII-armored versions as
> above. However, when I base64 encode the binary, or base64 decode
> the ASCII, the result does not match GPG's other version.

If you encrypt the same file twice, the output will be almost totally
different, as GnuPG uses a "session key" for encryption that changes
randomly for each call to GnuPG.
This will be true even for two subsequent encryptions of the same file
with both being either binary of ASCII mode.

When exporting a public/private key once as binary and once as ASCII,
you are processing the very same block of data using two different data
representations. Converting should work here.

HTH, Sven

More information about the Gnupg-users mailing list