When talking to RSA: you can use the PBKDF2 result to seed a pseudo-random number generator, which in turn can be used to create a key pair. Please note that using SecureRandom will not work, as it will add seed to the pool instead of fully reinitializing rng. RSA needs PRNG to search for a random prime.
You are better off if you can use cryptography with an elliptic curve. You can choose a standard NIST or Brainpool curve over F (p). You can then use the output of 32 bytes PBKDF2 as the private key and calculate the public key. ECC requires only a random private key, and since the output of PBKDF2 must be indistinguishable from random, the output will be perfect. Not only do you need additional PRNG, you can also spend your time calculating the RSA key pair yourself, and this can be significant.
Please note that nothing will prevent a brute force attack on something encrypted with the specified calculated key, so you are better off asking for a code phrase of 16 characters or more containing word words, numbers and signs. Anything less likely to fail, especially if users are not aware of possible attacks. Please note: if you do not have storage, you cannot use random salt. Unless you have a random salt that you cannot protect from rainbow tables (for your specific application, you can, of course, use the salt of the application). In addition, individuals with the same phrase will generate the same secret key.
Of course, the default method â for example, in PGP â is to store a secret key that is encrypted using password-based encryption. However, this requires storage. The advantage of this approach is that you can have a completely random key, which means that rude attacks against encrypted texts are impossible without access to the keystore. It adds an important extra layer.
source share