Is it safe to generate a public/private key pair from a users password using PBKDF2, and send the public key to the server to store as the user's key? Then when the user logs in, it would again generate the private key from the password, and use that to communicate with the server.

The salt would be generated by the server and sent to the client as part of the signup form; however, this salt would be completely unique to each request, and the chosen salt would be sent back to the server with the public key.

My thought is that this would solve the problem of tying up server resources if many users wanted to sign up. I am also wondering if it would be any more secure than simply salt and hash a million times.

Obviously, this is vulnerable to a MitM attack during sign up, but what isn't? It should be immune to an eavesdropper, correct? Except for password strength.

  • One downvote, no comments. Any thoughts? Commented Aug 14, 2017 at 14:33
  • Are you suggesting to use this instead of SSL/TLS? Or in addition to it?
    – John Wu
    Commented Aug 14, 2017 at 19:34
  • Definitely in addition to TLS, but that's an interesting question. Commented Aug 14, 2017 at 19:42

1 Answer 1


The main problem with your plan is that PBKDF2 is used for generating symmetric keys only. To generate a public/private key pair, you could potentially use the output of PDKDF2 to seed a random number generator and then use that RNG when coming up with the public and private keys. However, Javascript lacks the ability to seed the random number generator. So you'd have to roll your own, use a library, or generate the keys on the server.

I am struggling to see the point of all this, though. It seems like you are interested in using this mechanism to encrypt data in flight, but that is already taken care of by SSL/TLS. If you just want to encrypt data at rest in a manner where the server (and its administrators) are unable to access it, you could just use a symmetric key.

  • It would mostly be to prove you are authorized to access the server. It could be used to negotiate a symmetric key for performance, or just do some kind of handshake. I got the idea from SSH. And the main idea is to take the load off the server, since generating a private key takes far longer than encryption/decryption (I would think). However, since asking the question, I am basically coming to the same conclusion. Commented Aug 14, 2017 at 20:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .