im-infamou5 / gnupg-ecc

Automatically exported from code.google.com/p/gnupg-ecc
0 stars 0 forks source link

ECC NIST P-521 key decrypt issue #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm implementing pgp ECC support in one of our products and using this svn 
build of gnupg-ecc as reference.

I'm using the test data provided here:
https://sites.google.com/site/brainhub/pgpecckeys

I've found a couple of problems with the P-521 key and the encrypted packet.

When trying to import the keys, gpg2 complains that there are "no valid user 
IDs" and "this may be caused by a missing self-signature".

It's weird because if I do a --list-packets on the armor for the keys, I do see 
the proper signatures on both the main and sub keys for both the public and 
private keys.

I ended forcing gpg2 to load the keys using the --allow-non-selfsigned-uid 
switch.

When I actually try to decrypt the encrypted packet listed on that page, after 
entering the passphrase for the secret key, gpg2 reports that the public key 
algorithm is invalid. I traced through the code and when acquiring the session 
key (function get_it), the sk->public_ago value is 19 (ECDSA) instead of 18 
(ECDH).

This is again weird, because the --list-packets clearly show 18 for the subkey 
with that key id.

My program processes fine the P-256 encrypted and signed packets, the P-384 
encrypted and signed packets and the P-521 signed packet. But the AESWrap 
checksum on the P-521 encrypted packet fails.

What I'm wondering is if the P-521 encrypted packet is corrupt somehow?

Anybody else having problems with that sample packet?

Any advice would be appreciated.

Original issue reported on code.google.com by erne...@on-core.com on 23 Mar 2012 at 8:18

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I finally determined the issue to be a padding issue with the domain parameters 
of the curve in my program.

The sample P521 on the page now decrypts properly. Sorry about the confusion.

Original comment by erne...@on-core.com on 26 Mar 2012 at 8:23