DEV Community

Discussion on: How have I ensured the privacy and anonymity of my website users? 🤔

Collapse
 
waterlink profile image
Alex Fedorov • Edited

I store the same encrypted data in 2 forms:

  • normal encrypted data (password-based)
  • the same encrypted data for recovery (recovery-file-based)

When users create their password, I create 2 types of asymmetric key: password-based and recovery-file-based (this one is essentially a super-strong generated password).

As soon as this file is generated, it gets sent to the user over the email. It’s not stored anywhere else.

Now, when the user wants to use the “Forgot Password” feature, they’ll have to upload the recovery file.

The system then decrypts the data using the recovery-code-based private key, re-encrypts that using new user’s password and issues a new recovery-code for the user.