Node.bcrypt.js: salt on decrypt?

Created on 11 Mar 2017  路  1Comment  路  Source: kelektiv/node.bcrypt.js

Sorry, I'm dense:

How do I pass salt to compare()?
How can compare work w/o salt?

Most helpful comment

You do not need to pass a salt to compare because the salt is part of the hash that you are comparing the value against. To make it compatible across implementation bcrypt uses the modular crypt format to store data, which contains the salt embedded in it. See the glibc notes here for a description of the format http://man7.org/linux/man-pages/man3/crypt.3.html
Bcrypt is not supported by glibC, but the rest everything is applicable. bcrypt uses $2a$ as its identifier.

>All comments

You do not need to pass a salt to compare because the salt is part of the hash that you are comparing the value against. To make it compatible across implementation bcrypt uses the modular crypt format to store data, which contains the salt embedded in it. See the glibc notes here for a description of the format http://man7.org/linux/man-pages/man3/crypt.3.html
Bcrypt is not supported by glibC, but the rest everything is applicable. bcrypt uses $2a$ as its identifier.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CMatias picture CMatias  路  4Comments

Z3roCoder picture Z3roCoder  路  5Comments

alanosman picture alanosman  路  3Comments

targos picture targos  路  4Comments

youngrrrr picture youngrrrr  路  5Comments