I'm implementing field level end to end encryption (e2ee) to customer data stored in a DB, this DB is using by a RESTFUL web application (angular) through a web API.

API generates an encryption key per user and it symmetrically encrypts that encryption key with the user's raw password+credentials and store in a DB.

Every time user should provide the password to web API to get his encryption key decrypted and using that key, the web API decrypts customer data and provides to RESTFUL WebUI.

When in a situation which customer looses his password he is getting unable to access his data.

Is there any solution to this lost password scenario problem? However the e2ee should always be available and our web API/UI staff/developers/management should have zero knowledge of customer data.

  • 1
    if done right, no, a lost password should burninate the data. that aside, you need to properly derive the password into a key (didn't see that mentioned and "raw password" is scary).
    – dandavis
    Oct 13, 2017 at 6:35
  • @dandavis I'm wondering how lastpass/1password does this? Thanks for the password tip, the raw password would be hashed with a secret.
    – inckka
    Oct 13, 2017 at 6:59
  • @inckka They store some authentication details on devices that users log in from, and allow recovery from those specific devices. If you can't do that, some packages allow for team recovery, but otherwise they consider the data as lost. It's considered better to have to reset all passwords for everything than to potentially lose all passwords to a malicious attack.
    – Matthew
    Oct 13, 2017 at 8:32

1 Answer 1


Whatever the gory details, encryption key recovery requires a backup of the key. A common way is to store that backup copy in encrypted from, using the public key of a key master - generally a team administrator. That way, if the user loses his key, the key master can recover the data.

But if you offer that recovery system, you (someone in your staff) automatically have a hidden backdoor to your users data and break the zero knowledge rule.

The more you can do is to warn your users that if they lose their password, all their data will be irremediably be lost, and advise them to keep a secure backup of their password/key. Depending of the requirement, a sealed envelope in a physical safe can be fine, or a password vault on a external device (USB key, smartphone, ...)

You must log in to answer this question.

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