Hi Russell,

Thanks for your answer.  Generating a 256 bit key takes 12 seconds on an
Athlon 3000 in debug.  It takes 5 seconds in release.  I believe this is too
slow, especially for a game.

I didn't measure it carefully, but decoding a key causes a noticeable pause.
Fortunately, I only use RSA for the connection handshaking but I still think
this is bad.

Also, the mpuint library causes memory access errors in boundschecker so I
would like to replace it with something else.

I've actually spent about 12 hours on this so far today, most of that
programming, but part of it searching for libraries on google and haven't
found anything yet.  I've found some excellent documentation on how to do a
fast implementation - but it would take me a very long time to write and I
don't want to reinvent the wheel unnecessarily.

So to reiterate, if anyone knows of a fast implementation to generate keys,
or at least one faster than what I have, and something where I can just pull
out the two functions and maybe an integer library, I would really
appreciate it.

Thanks in advance,

Kevin

----- Original Message -----
From: "Russell Robinson" <[EMAIL PROTECTED]>
To: "Kevin Jenkins" <[EMAIL PROTECTED]>
Sent: Tuesday, July 20, 2004 9:39 PM
Subject: Re: Need code to generate RSA keys


> Hi Kevin,
>
> Kevin> I found some code at http://efgh.com/software/ that has exactly
what I need:
> Kevin> void GenerateKeys(mpuint &d, mpuint &e, mpuint &n);
> Kevin> void EncryptDecrypt(mpuint &result, const mpuint &source, const
mpuint &e,
> Kevin> const mpuint &n);
>
> Kevin> The problem with that code is that it is not optimized and so is
too slow.
>
> What makes you think it's too slow?
>
> Generating public and private keys is a very CPU intensive task. I
> don't know the software you've mentioned, but it's probably operating
> at normal speed.
>
> It also depends on how big you want the key (modulus) to be.
>
> As a benchmark, one of our products generates a public/private key
> pair with a 2304 modulus using Crypto++.  It takes 17 seconds to do
> this on a Pentium III 800MHz computer.

Reply via email to