6
$\begingroup$

I have a specific use case I am interested in. I have spent the better part of the night reading research papers. I am beginning to believe what I want is not possible so I wanted to confirm here.

Scenario: I have customers with a private key. However, this private key is on the device they installed my software on. They have no clue what or why they have a private key and could care less. This is important for using the software. They can also use the software on their phone, not just their desktop. I need a way to get that private key on both devices without them communicating with each other but only through me. I however, do not want to be in contact with the raw private key.

I am happy to store an encrypted version of this key but I don’t want the ability to decrypt it.

I am also aware of the fact that I can use a password. So device A can have the user enter a password which can be used to encrypt the key and then they can send it to me to store. Then on device B I can send them the encrypted key and they can use the password to decrypt it. This is trivial.

The key requirement I am trying to get to is I don't want a user to have to enter a password on each device to be able to decrypt the key. The only passwordless solution I found in my research requires the devices to communicate to agree on a key. This would mean both devices have to be online at the same time. So the only real world way to do this is to have a user perform an action on device A ( if not online ) to be approved for device B which I do not want as it is friction for the user. Again this is all in the background and not applicable to their usage of the app. So to summarize:

  • Do not store key or decryptable key on my servers
  • Customer does not have to enter a password or anything like it
  • Both devices do not need to communicate (offline)
$\endgroup$
  • $\begingroup$ Do you have a way to correlate the two devices to the same user ? If you do, you can effectively do something like the X3DH key agreement(signal.org/docs/specifications/x3dh). You can have each device register keys with you the first time they use your app on each device. Have your app on each device look for other devices every time it is used that may be registered with you and perform a key exchange asynchronously. You dont need both devices to be online for the key exchange at the same time. $\endgroup$ – Raghu Feb 9 at 0:36
  • $\begingroup$ I do. Both devices authenticate as the same user. $\endgroup$ – Mark Feb 9 at 0:38
  • $\begingroup$ Only problem would be that this requires the new device to wait until the other device comes back online, to get the decryption key and use the data. That could be fast but it could also be the next day which would be bad for usability. Kudos though, this is the closest solution yet. $\endgroup$ – Mark Feb 9 at 0:47
  • $\begingroup$ Okay. X3DH should work to meet your requirements. You wont have access to the private key on each device and your user does not have to enter a password, and not have them be online at the same time. Your user will however have to verify the fingerprint of each devices public key before sending data. If not you could MITM attack the devices. As for your problem about waiting for the data, you can have the device send you encrypted data to the server and store it for them and forward it the devices as needed. $\endgroup$ – Raghu Feb 9 at 0:52
  • 1
    $\begingroup$ The first message that is sent to the second device is effectively a key exchange message stored on the server. When the 2nd device comes back online, this message can be pushed or pulled into the app, the key exchange message it’s then processed, after which it will have the decryption key for the data. That way the second device does not need to wait for the first device. $\endgroup$ – Raghu Feb 9 at 4:00

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.