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

Commit for issue #64 erroneously removed "$s0" prefix from scrypt hash strings #66

Closed
dpatriarche opened this issue Aug 10, 2022 · 2 comments

Comments

@dpatriarche
Copy link

Describe the bug

The commit for issue #64 erroneously removed the "$s0" prefix from scrypt hash strings. The "$s0" prefix is present in the hash string generated by the original lambdaworks scrypt library's SCryptUtil.scrypt() function (from package: "com.lambdaworks:scrypt:1.4.0"). From the lambdaworks scrypt library's README.md, the "$s0" prefix indicates "version 0 of the format with 128-bit salt and 256-bit derived key".

To Reproduce

Using the scrypt library, call com.lambdaworks.crypto.SCryptUtil.scrypt() with any values for parameters passwd, N, r, and p. The returned hash string will have the "$s0" prefix.

Expected behavior

Password4j's scrypt hash strings should have the same format as hash string generated by the lambdaworks scrypt library, which includes the "$s0" prefix.

Environment:

  • OS: Any
  • JDK Any
  • Version 1.6.0

Additional context

@firaja
Copy link
Member

firaja commented Aug 11, 2022

Hello @dpatriarche,

The s0 is not part of the standard but something invented by the guy that developed the scrypt library and that lambdaworks uses.
The problem with lambdaworks is that it is an homemade archived library.
For example passlib for Python and Spring Security are not affected by this issue.
PS: I'm on vacation, so I'm not able to do further checks and I may remember things differently than they are. So feel free to correct me 😃 🍹

@dpatriarche
Copy link
Author

Hi David -- Thank you for the explanation. I'll add a comment to issue #64 for anyone else who runs across this issue migrating a password database created using lambdaworks scrypt to password4j.

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