You are currently viewing Salting the hash

Salting the hash

First let me get the dad joke out the way. “I like my hashes like I like my steak….perfectly salted”.

Salting hashes is an awesome way to insure that breached databases containing hashed password remain secure (because the salting method would remain unknown).

When a password is hashed, it is transformed into a fixed-length string of characters, or a hash, using a cryptographic hash function. This hash is then stored in a database, and is used to verify the user’s password when they try to log in.

To prevent attackers from using precomputed hashes to crack passwords, a random string of characters, known as a salt, is added to the password before it is hashed. This salt is unique for each password and is stored along with the hashed password in the database.

When a user tries to log in, the salt is retrieved from the database and added to the password they enter. The combined salt and password are then hashed, and the resulting hash is compared to the one stored in the database. If the hashes match, the user is authenticated.

Hash salting makes it much more difficult for attackers to crack passwords, as they would need to compute hashes for every possible combination of salt and password in order to find a match. This makes it much more time-consuming and resource-intensive for attackers to crack passwords, and helps to protect the security of the system.

Leave a Reply