some questions

Matthew Byng-Maddick gnupg at
Mon Jun 23 14:28:02 CEST 2003

On Mon, Jun 23, 2003 at 12:45:30PM +0200, Hagen Paul Pfeifer wrote:
> * Matthew Byng-Maddick | 2003-06-23 09:52:59 [+0100]:
> >You're missing stuff about the way that RSA works.
> Not really ;-) RSA -the mathematic- is not the problem, the
> implementation is the problem. Cause RSA dont need block padding,
> session keys ...

Correct. However, it does need padding (mathematically) to be in any way
useful as a security system (note my comment about P being of the same
order as n).

> I need information about the implemantation.
> >It creates a session key, as is documented. It then pads and encrypts that
> >key, and uses that to do AES/IDEA/some other symmetric algorithm on the
> >data, with appropriate padding at the end to get the data to a block
> >boundary.
> Thanks, this information is usefull for me. Exist there some details
> about the implementation in the public (except the source code ;-) ?

The implementation is defined in RFC2440 (which defines the packet formats
and certain properties of the padding used to do the RSA encryption).
Also you could have found:, which
explains about the session key.

> >> second question:
> >> when I list keys, all keys a represented by digits and characters (and
> >> unprintable characters without -a). My rsa implementation only show
> >> digits (of course), why? And how can I extract e and n of a public key?
> >I'm not sure how you get this out without patching the source. That bit
> >is fairly easy to read, and it is probably relatively easy to patch to
> >print out the numbers from the big num.

> 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.

> >UTSL ?
> To difficult for me, sorry.

Why do you need the e and n, then?


Matthew Byng-Maddick         <mbm at> 

More information about the Gnupg-devel mailing list