How to derive a 4096 bit or 8192 bit RSA private key from a (BIP39) mnemonic seed?

Any tool available for this?

  • 2
    $\begingroup$ You could use the seed to instantiate a pseudo-random number generator (PRNG) and from it generate numbers until you find two primes. You can test if a number is prime efficiently with probabilistic primality tests such as Miller-Rabin. $\endgroup$ – corpsfini Dec 10 '19 at 10:51

As it was already pointed out in a comment by @corpsfini, you could use a PRNG to generate pseude-random numbers from the seed. Then you would check whether they are primes using some probabilistic primality test.

In spirit the same procedure is implemented in this github repo you might find useful.

| improve this answer | |
  • $\begingroup$ That uses a non-secure hash, so I doubt that the PRNG is secure; it actually mentions on the SO post that it is derived from that it isn't. Now possibly this won't be exploitable in the wild, but you'd have to prove that. $\endgroup$ – Maarten Bodewes Apr 1 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.