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

Any security downsides to auto-generating salt? #128

Open
pietrorea opened this issue Feb 4, 2022 · 0 comments
Open

Any security downsides to auto-generating salt? #128

pietrorea opened this issue Feb 4, 2022 · 0 comments

Comments

@pietrorea
Copy link

pietrorea commented Feb 4, 2022

Hello πŸ‘‹ β€” are there any known security implications for generating the salt separately from the hashing call? Specifically...

Doing them separate:

var salt = bcrypt.genSaltSync(10);
var hash = bcrypt.hashSync("aPassword", salt);

All in one go:

const passwordHash = bcrypt.hashSync('aPassword', 10);

I guess you could provide your own salt? Is that a common practice? Otherwise, why did you include two separate ways to achieve the same thing in the API?

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