If modern hash algorithms use salts, how are hashed passwords compared to check a correct result?

274 views

I’ve used hashing algorithms back in my PHP days using bcrypt, which has a function to compare an entered password on the login form, to the hash stored in the database, but if the salt is random each time, how can the hash be checked?

In: Technology

4 Answers

Anonymous 0 Comments

The salt is random, but static. It is created when the entry is created in the hash table and stored alongside the hash.

When you enter your password, it is hashed along with the stored salt and then compared to the hash entry in the table.

You are viewing 1 out of 4 answers, click here to view all answers.