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

Salt with 31 rounds is insecure because of bitwise shift #25

Closed
tanertopal opened this issue Aug 1, 2015 · 0 comments
Closed

Salt with 31 rounds is insecure because of bitwise shift #25

tanertopal opened this issue Aug 1, 2015 · 0 comments

Comments

@tanertopal
Copy link

The salt with 31 rounds is insecure. The bitwise shift here:

rounds = 1 << rounds;

Will result in -2147483648 not 2147483648. So this:
https://github.com/dcodeIO/bcrypt.js/blob/d5d46150e9da7d15d3f70fd97649e923d95013af/src/bcrypt/impl.js
will never run.

Pull request #24

@tanertopal tanertopal changed the title Salt with 31 rounds is insecure. Salt with 31 rounds is insecure because of bitwise shift Aug 1, 2015
@dcodeIO dcodeIO closed this as completed in dd6eaf7 Aug 2, 2015
tanertopal added a commit to tanertopal/bcrypt.js that referenced this issue Aug 3, 2015
* commit 'dd6eaf724afc72618126782de8dfb061c1a5ae90':
  Prevent integer wrap-around with 31 rounds, fixes dcodeIO#24, fixes dcodeIO#25

Conflicts:
	dist/bcrypt.js
	dist/bcrypt.min.js
	dist/bcrypt.min.map
	src/bcrypt/impl.js
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

1 participant