problem encrypting with someone else's key

Charles Spitzer cspitzer at godaddy.com
Mon Mar 17 00:21:45 CET 2014


Even stranger, I had the same version of gpg installed on a friend's machine. He encrypted a file containing only a HelloWorld with the same key, and I did the same. The encrypted files weren't the same. He didn't use, to my knowledge, a sign on it.

Here's the list-packets info. Yes, this was encrypted with the GIS key, which is what I used.

C:\Users\cspitzer\Documents\GIS-WOTC>gpg --list-only --list-packets HelloWorld.txt.gpg
:pubkey enc packet: version 3, algo 16, keyid 9AAF93486C842B6C
        data: [1021 bits]
        data: [1023 bits]
:encrypted data packet:
        length: 38
gpg: encrypted with 1024-bit ELG key, ID 6C842B6C, created 2005-02-16
      "GIS <giseservices at geninfo.com>"

C:\Users\cspitzer\Documents\GIS-WOTC>gpg --list-keys 9AAF93486c842B6C
pub   1024D/9EBA10E1 2005-02-16
uid                  GIS <giseservices at geninfo.com>
sub   1024g/6C842B6C 2005-02-16

and here's the file he sent me:
C:\Users\cspitzer\Documents\GIS-WOTC>gpg --list-only --list-packets HelloWorld.txt.bill.pgp
:pubkey enc packet: version 3, algo 16, keyid 9AAF93486C842B6C
        data: [1024 bits]
        data: [1023 bits]
:encrypted data packet:
        length: 32
gpg: encrypted with 1024-bit ELG key, ID 6C842B6C, created 2005-02-16
      "GIS <giseservices at geninfo.com>"

which is the same key. When I exported my key, I used Kleopatra and didn't say to create an export with a sign, so I'm not sure what's exactly in the set of bytes that are in the file.

I, of course, can't try to decrypt this, as I don't have their key. I'll have to ask what kind of errors they're getting, or whether they just get gibberish out of it. They only said it doesn't work.

Thanks for your help.

Regards,
Charlie

-----Original Message-----
From: Hauke Laging [mailto:mailinglisten at hauke-laging.de] 
Sent: Sunday, March 16, 2014 10:42 AM
To: gnupg-users at gnupg.org
Cc: Charles Spitzer
Subject: Re: problem encrypting with someone else's key

Am So 16.03.2014, 15:48:18 schrieb Charles Spitzer:
> So, I used gpg 2.22 to import someone's key, and then encrypted a file 
> with it. I sent it to them, and they couldn't decrypt it for some 
> reason.

It is difficult to debug this if you don't tell us how exactly you did this encryption. Did you encrypt on the command line?


Run this for the encrypted file:

gpg --list-only --list-packets tmp.txt.gpg

You should get output like this:

:pubkey enc packet: version 3, algo 1, keyid 764311F281F06169
        data: [2045 bits]
:encrypted data packet:
        length: 1703
        mdc_method: 2

If it looks like this, run

gpg --list-keys 764311F281F06169

Is that the key of the recipient?


> I then exported the same key, and found that the export file doesn't
> match the key that I imported. Shouldn't it be the same, or is there
> something in the exported key that is specific to the machine it came
> from?

You may have made a public signature for the key which, of course, was 
not part of the certificate you imported. Or the import file contains 
signatures gpg ignores when importing (or at least when exporting): 
Useless and old signatures (replaced by newer ones) may be ignored.


> How can I debug this?

The same way:

gpg --list-packets import_file
gpg --list-packets export_file


> I don't know what they're using to
> decrypt, but they are certainly using pgp.

May help to know the exact error message they get.

They may get a better error message if they try to decrypt in the 
console:

gpg -vvv your_file.gpg


Hauke
-- 
Crypto für alle: http://www.openpgp-schulungen.de/fuer/unterstuetzer/
http://userbase.kde.org/Concepts/OpenPGP_Help_Spread
OpenPGP: 7D82 FB9F D25A 2CE4 5241 6C37 BF4B 8EEF 1A57 1DF5


More information about the Gnupg-users mailing list