in reply to Re: Generate RSA keypair in perl efficently with custom PRNG
in thread Generate RSA keypair in perl efficently with custom PRNG

But isn't using Math::Primality a slow method of generating keys?

Isn't there any way to supply own random data to a *Efficient* key generating process, that generates a keypair fast and efficiently?

I tried with a another key generating process but it took about 1 minute to generate a 256 bit RSA keypair. Thats too slow. I need a fast and efficient method.

  • Comment on Re^2: Generate RSA keypair in perl efficently with custom PRNG

Replies are listed 'Best First'.
Re^3: Generate RSA keypair in perl efficently with custom PRNG
by zwon (Abbot) on Feb 19, 2011 at 16:16 UTC

    You can use also Math::GMPz, which uses GMP library:

    use 5.012; use warnings; use Math::GMPz qw(:mpz ); use Digest::SHA qw(sha512_hex); my $sha = sha512_hex('password'); my $op = Rmpz_init_set_str($sha, 16); my $rop = Rmpz_init2(512); Rmpz_nextprime($rop, $op); say Rmpz_get_str($rop, 16);
    it takes less than a second on my notebook.