Skip to content

Any security downsides to auto-generating salt? #128

Closed as not planned
Closed as not planned
@pietrorea

Description

@pietrorea

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions