problem encrypting with someone else's key

Hauke Laging mailinglisten at hauke-laging.de
Sun Mar 16 18:41:38 CET 2014


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: </pipermail/attachments/20140316/ff0aed07/attachment.sig>


More information about the Gnupg-users mailing list