5 ms·
Oh ok, I guess this doesn't happen with bcrypt, right? Because it spits out a different hash every time you hash it.
by truth_sentinell 10y ago
Oh ok, I guess this doesn't happen with bcrypt, right? Because it spits out a different hash every time you hash it.
- gruturo 10y agoUh? Of course not. It will spit out exactly the same hash every time, given the same input. How else would you verify that the password matches ?
- truth_sentinell 10y agoI don't know. Laravel uses a hash algorithm that uses bcrypt and never outputs the same hash.
- nommm-nommm 10y agoBcrypt uses 22 character salt. The output of your library's BcryptEncoder.encode(password) includes not only the password hash but information about the algorithm and the salt. That's what you store in your database. That extra information tells the decode function how to decode later on. See here: http://stackoverflow.com/questions/6832445/how-can-bcrypt-have-built-in-salts http://stackoverflow.com/questions/6832445/how-can-bcrypt-ha...
- nommm-nommm 10y agoTry it, it doesn't. The Bcrypt algorithm generates salts and the salt is built into the outputted hash.