0

I want to use multiple clients but I don't want different public key for that specific user. So I have to share the private key between all clients that I only have to use one public key. So I thought if it is secure to encrypt the private key with aes of the first client which generates the key with an password and then send it to the server which stores it in the database. And when a user uses another client the encrypted private key in the database is sent to the new client and can be decrypted with the users password so the client can also receive messages with only one public key. Is this a good way to go? I cannot think of another way to use RSA with multiple clients.

Ps: This is for a secure chat system!

0

If encrypted private key can be requested by an attacker (you didn’t specify any authentication for the request) or your servers are compromised then you’re opening your users to offline attacks. Now the only barrier between attacker and user’s private key is the user’s password.

Generating per-device key pairs is preferable, for example user can deauthorize key pair of a lost device.

If you insist on sharing one key pair I suggest transferring it from client to client within an end to end encrypted channel. This way:

  • the private key transmission is protected by a much more secure keys generated by DH key agreement. Beware of MITM attacks, they could be discovered by comparing hashes of keys between the devices
  • the encrypted key is transmitted only once and never stored, unless the attacker is eavesdropping at the moment of transfer
  • the transfer could be performed directly between the devices through a local network or a cross-nat p2p protocol. This fully excludes your server.

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.