1

I'd like to resuse the mnemonic I have from bip39 for crypto in other domains such as ssh and tls, etc. Are there standard tools (ie, openssl) to deterministically generate rsa key/pairs given a seed value? I know technically it is possible using PBKDF2 to create a PRNG etc, but I'm definitely not looking to roll my own crypto.

I'm just wondering if there is an easy way using openssl or gnu to reuse my bip39 mnemonic in other contexts besides crypto. Or if there is a way of converting the derived key pairs from one algorithm into rsa using standard libraries.

Thanks.

2 Answers2

2

Generating an RSA key is a complex process with many steps that can be implemented with many small variations. It involves generating two probable primes and verifying that they're suitable. Generating a probable prime means generating a random number in the desired range, checking that it isn't divisible by a small prime, and applying a probabilistic test that itself consumes randomness. The exact way to consume randomness, the choice of how many small primes to check for, the details of the implementation of the probabilistic test all determine when a suitable candidate will be found. As a consequence of all these possible variations, specifications for generating an RSA key generally do not specify all the details. And thus every library out there has its own variations, and the details of key generation often vary from one version to the next. You can't just plug a deterministic pseudorandom generator into that process and hope to get a reproducible outcome unless you take one specific piece of code and stick to it.

Using a single root key to generate multiple keys for different purposes is a bad idea anyway. (There are limited cases where it's the only thing you can do. You are not in such a situation.) You would need to have this root key available every time you derive any of the keys, putting it at risk of exposure. And if that key is ever compromised, then so would all your keys.

Memorize the master password of your password manager and use a password manager to store your keys. Only every use your password manager on devices that you fully control.

0

For generating RSA keypairs from BIP39 mnemonics, a quick search give me three tools. but it is a bad method for deriving key pairs. A better method is using Key Derivation Functions with a standard tool like GnuPG.

Hypatia
  • 375
  • 1
  • 6