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

In pwHash, sodium.crypto_pwhash_MEMLIMIT causes error when set to SENSITIVE #4

Open
willemolding opened this issue Feb 27, 2019 · 0 comments · May be fixed by #6
Open

In pwHash, sodium.crypto_pwhash_MEMLIMIT causes error when set to SENSITIVE #4

willemolding opened this issue Feb 27, 2019 · 0 comments · May be fixed by #6

Comments

@willemolding
Copy link
Contributor

Using the util.pwHash helper function I run in to some issues when hashing passwords. If the memlimit is set to sensitive it sometimes crashes with this error:

Uncaught (in promise) Error: invalid usage
    at b (libsodium-wrappers.js:1)
    at Object.Te [as crypto_pwhash] (libsodium-wrappers.js:1)
    at util.js:108
    at <anonymous>

This is repeatable in the Chrome test browser I am using for Cypress integration tests but it appears to work fine in Firefox and regular Chrome.

Setting the memlimit to crypto_pwhash_MEMLIMIT_INTERACTIVE as suggested here allows it to work correctly in the chrome test browser. Not sure what the ramifications of this are...

As an aside, the hashing is MUCH faster when the memlimit is set to interactive. It is very slow (~3-4 seconds) using the original configuration.

@willemolding willemolding changed the title sodium.crypto_pwhash_MEMLIMIT causes error when set to SENSITIVE In pwHash, sodium.crypto_pwhash_MEMLIMIT causes error when set to SENSITIVE Feb 27, 2019
@willemolding willemolding linked a pull request Mar 4, 2019 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant