some questions

David Shaw dshaw at jabberwocky.com
Tue Jun 24 16:48:02 CEST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Jun 23, 2003 at 12:30:02PM +0100, Matthew Byng-Maddick wrote:

> > I don't understand your awnser for my question. I repeat: How can I
> > extract e ( gcd(e, phi ) == 1) and n ( q * p )  from a key that i list
> > with "gpg -a --export key-id". Cause it print's one whole character
> > stream on stdout. Furtermore: it contains not only numbers?!
> 
> What it contains is the base64 encoded packet stream. The numbers are
> stored in binary. In order to do this, you'll need to patch the source,
> there doesn't appear to be an easy way to extract e and n from running
> gpg. You should be able to get at them from the ASCII armoured output by
> reading RFC2440, which should specify everything you need to know about
> that output.

There is a little-used feature to dump out the key data:

  gpg --with-key-data --list-keys key-id

For an RSA key, the "pkd:0" number is n, and the "pkd:1" number is e.

David
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3rc1 (GNU/Linux)
Comment: Key available at http://www.jabberwocky.com/david/keys.asc

iD8DBQE+91xa4mZch0nhy8kRAqD4AJ0c+XTS1rYYhXGUl2E2w4gKz3ZywACfRCwm
3fTEj1suq0p8GsNecghxr+k=
=zoW8
-----END PGP SIGNATURE-----




More information about the Gnupg-devel mailing list