1

So I have been searching everywhere and havn't been able to find anything with the sufficient information I need.. so Im a bit stumped on this one at the moment

What I am trying to do is create a public/private key pair (like PGP) upon a users account creation, based on their passphrase and a random seed. The public key would be saved on the server, and ideally the private key would never be seen by the server whatsoever. The user could then sign in, and send a message to another user. Before the message is sent, the senders key pair would be re-generated on the fly based on their credentials (and maybe a password prompt) and used to encrypt the message. The receiver would then use their own re-generated private key to decrypt said message.

The server itself should never see any plaintext passwords, private keys or readable messages.

Bit unsure how on how I could go about implementing this. Iv been looking into PGP, specifically openPGP.js. The main trouble I am having is being able to regenerate the key-pair based off a specific seed. PGP seems to have a random output even if the inputs are the same. Storing the private key in a cookie or in HTML5 storage or something also isnt really an option, too unreliable.

Can anyone point me in the right direction?

migrated from stackoverflow.com Oct 29 '13 at 23:15

This question came from our site for professional and enthusiast programmers.

  • You can't find much because your plan is unusual, though I've seen it before. Usually the RSA key pair is generated once from a good entropy source, and the password is only used to control access to the private key. – James K Polk Oct 19 '13 at 13:40
  • How would that work? Store the full keypair on the server, but encrypt the private key so that it can only be decrypted with the correct password? – SlickTheNick Oct 19 '13 at 17:42
1

What you are looking for is a variant of a zero-knowledge proof where you can stash some data on a set of servers and use them to recreate your credentials. Here is a pretty good paper that describes how that would work:

Password authentication using multiple servers

Also, there is a company that does something really similar to this for you (full disclosure, I work there) and makes it available via a library:

Adrenaline Mobility

  • Hmm, your link to that paper appears to be broken. Also your company's website doesnt exactly tell me anything useful or even describe their services really. Thanks though – SlickTheNick Oct 19 '13 at 18:00
  • I updated the link for Adrenaline to one that has more concrete information. Our system does exactly what you are asking for -- given a password it recreates a public/private key pair for users without needing to trust the server. There are some differences (we use elliptic curve instead of RSA), but it appears to be very similar to what you are asking for. – Sam King Oct 19 '13 at 23:48

Your Answer

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