Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

How To Reset Password If Forgot Password #19

Open
phpgraduate opened this issue Feb 4, 2021 · 3 comments
Open

How To Reset Password If Forgot Password #19

phpgraduate opened this issue Feb 4, 2021 · 3 comments

Comments

@phpgraduate
Copy link

Hi, I'm trying to add forgot password function in this repo to set a new password.
/**
* Forgot password
* @param newPassword
* @throws error, if newPassword is incorrect
*/
forgotPassword(newPassword) {
if (newPassword != "") {
let enc = new TextEncoder("utf-8");
this.chaChaPassword = new ChaCha20(this.keyPassword, this.keyPasswordNonce).encrypt(enc.encode(newPassword));
this.useDefaultPassword = false;
}
else throw new Error("Incorrect old password");
}

I tried this but it is not working can anyone help me with this.

@Nikolasel
Copy link
Owner

Basically the secrets are differently encrypted depending on the Storage. On hard drives they are encrypted using OpenPGP symmetric encryption and in Memory via ChaCha20.
If you only have a the file that is placed on the hard Drive, the only possibility to recover it is via cracking. Depending on the password strength this can take years.

@phpgraduate
Copy link
Author

Does it mean if I forgot the password I can never access my account?

@Nikolasel
Copy link
Owner

Correct, otherwise encryption makes no sense, everyone is then able to reset the password.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants