Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to try different secrets from user input #50

Open
tiggerbiggo opened this issue Apr 19, 2024 · 1 comment
Open

Unable to try different secrets from user input #50

tiggerbiggo opened this issue Apr 19, 2024 · 1 comment

Comments

@tiggerbiggo
Copy link

Hi,

I am building a small script which will take a secret from the user, and validate that it was correct before attempting to decrypt the main data.

To do this I need to be able to try a secret that may not be the correct one, attempt to decrypt a pre encrypted string that will result in a known value, and it will only result in the correct check string if the secret is right.

If at any point I instantiate a second instance of Cryptr (for example if the user gets it wrong), the program crashes with “Unable to read options file: Cannot read properties of undefined (reading decrypt)”. This means once I instantiate a Cryptr instance with one secret, it is then impossible for me to ever use a different secret.

@KoryNunn
Copy link
Contributor

There is a test for multiple instances of cryptr: https://github.com/MauriceButler/cryptr/blob/master/tests/index.js#L34

If you can write a failing test for this issue, send a PR and I'll look at it.

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

No branches or pull requests

2 participants