1

With Blowfish, what's the point of storing the salt since we can extract it from the hash?

$hash = crypt($password, $salt);

To get the hash we can use

substr($hash, 0, 28)

or

substr($hash, 0, 29)

I don't know if the dot is from the salt or the hashed password though.

Vilarix
  • 735
  • 1
  • 10
  • 16

1 Answers1

0

A salt value is used to make "rainbow table" attacks harder. Without a random salt a password would always produce the same hash and if you could "aquire" a password database full of those hashes you could easily check them for the known hashes of e.g. the top100 most used passwords. With a salt you can of course try those too but you have to call the hash function for each salt and that takes a lot of time as hash functions are designed to be "slow" to make brute force attacks hard.

lathspell
  • 3,040
  • 1
  • 30
  • 49