some questions

Matthew Byng-Maddick gnupg at
Mon Jun 23 11:51:10 CEST 2003

On Sun, Jun 22, 2003 at 11:29:22PM +0200, Hagen Paul Pfeifer wrote:
> I had some questions about some implementation details:
> first question:
> How does gnupg with rsa encryption encrypt text, especially how big is the
> block size? I can't find no information about it.

You're missing stuff about the way that RSA works.

> Or does encrypt it every character?
> e.g. 'A'^e mod n  (I don't think so)

That would be an appallingly bad idea. Basically, in RSA you really need
what you've called 'A' to be on the same order as n, which you achieve by
padding, or else the multiplied value never wraps around the mod, and you
can trivially raise to the inverse power. Part of the security comes from
the fact that you can't tell how many times you have wrapped the numberspace.

> For example the block size is 50 byte, how does gnupg handle a text
> like: "hello world"?

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

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

> sorry for this questions but I can't find some information in the net



Matthew Byng-Maddick         <mbm at> 

More information about the Gnupg-devel mailing list