My question is about hashing procedure.
const bcrypt = require('bcrypt');
const saltRounds = 10;
var password = "Fkdj^45ci@Jad"; // Original Password
var password2 = "djlfhjd(456"; // Wrong Password
bcrypt.hash(password, saltRounds, function(err, hash) {
bcrypt.compare(password2, hash, function(err, result) {
...
});
});
This is a code snippet for hashing with salt and comparing. I can't understand how it is possible to compare hash and password without knowing salt. bcrypt is using Blowfish now, but how is it possible for a having algorithm to compare a password and a hash value without knowing salt?