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

Add salt and timing safe compare #17

Merged
merged 2 commits into from
Oct 26, 2018
Merged

Add salt and timing safe compare #17

merged 2 commits into from
Oct 26, 2018

Conversation

tlbdk
Copy link
Member

@tlbdk tlbdk commented Oct 26, 2018

No description provided.

@@ -39,7 +39,8 @@ app.use('/api/login', (req, res) => {
let username = req.body.username

// Here we do a simple hashed password check
crypto.pbkdf2(password, 'salt', 100000, 64, 'sha512', (err, derivedKey) => {
const salt = crypto.randomBytes(16)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want per-password salts, instead of a global one, you should store this together with the hashed password? And use it for the verification-encoding?

@tlbdk tlbdk merged commit 2705e7d into master Oct 26, 2018
@tlbdk tlbdk deleted the samplefixes branch October 26, 2018 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants