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

Weird hash errors with certain parameters #174

Open
qqux opened this issue May 19, 2018 · 1 comment
Open

Weird hash errors with certain parameters #174

qqux opened this issue May 19, 2018 · 1 comment

Comments

@qqux
Copy link

qqux commented May 19, 2018

> scrypt.kdfSync(new Buffer('asd'), s.paramsSync(5.0))
<Buffer 73 (...) 18 ... >

Seems good enough, let's try hashSync with similar parameters.

> scrypt.hashSync(new Buffer('asd'), s.paramsSync(5.0), 64, new Buffer(''))
Error: ��_�
    at Object.hashSync (<redacted>/node_modules/scrypt/index.js:359:25)

Now that doesn't look right at all. Let's try the example from one of the test vectors.

> scrypt.hashSync(new Buffer(''),{"N":16,"r":1,"p":1},64,new Buffer("")).toString('hex')
'77d6 (...) 8906'

Works right.

The parameters which are generated by scrypt.paramsSync(5.0) in my case are

{ N: 18, r: 8, p: 5 }

Ubuntu Server 18.04, running node v8.11.2.

@ml1nk
Copy link

ml1nk commented Jun 18, 2018

It should be the same issue as of patch: do not reference arguments directly #120 . Does the version on @ml1nk/scrypt work?

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