How could I best implement a reset password functionality for a password manager? I'm currently saving a hashed + salted master password, and encrypting the passwords with the master password itself, however if a user has lost his master password this means the passwords can't be decrypted.
I thought about saving a version of the passwords encrypted with the master password and a version encrypted with the users email + some random token generated when the user creates his account, but would this be safe? Is there any best practice when doing this?
The user's email also only gets stored as a hash.
So to clarify my question, are there any best practices for recovering data encrypted with a password if that password is lost?
PBKDF2
,password_hash
,Bcrypt
and similar functions. The point is to make the attacker spend a lot of time finding passwords by brute force. – zaph