liveBook · Manning

Cryptographic salt

As explained in Fundamentals of Cybersecurity

A salt is a random value combined with input before hashing to prevent identical inputs from sharing the same hash and to hinder precomputed attacks.

A cryptographic salt is a unique, random value added to a password before it is hashed. The salt makes the stored hash different even when two people choose the same password. section 12.3.3

This matters if an attacker gets a password database. A rainbow table lets attackers look up precomputed hashes instead of hashing every guess. Those precomputed hashes do not match passwords hashed with unique salts, making that shortcut ineffective. section 12.3.3 section 14.2.4

The same salt must be available when the password is checked:

  • At creation, generate a unique random salt, combine it with the password, and hash the combination. section 12.3.3
  • Store the salt so it can be used again during password validation; do not store the original password. section 12.3.3

Same password, different hashes

Suppose two employees both choose “querty123.” With a different salt for each account, their stored hashes differ. An attacker looking at the hashes cannot use a matching hash to tell that the passwords are the same. section 12.3.3

User
Password
Salt
Hash
Alice
*******
3fA9Z!8b
b3c7e6a7f9f7d6dcb83662
Bob
*******
N@5l1p2Q
7a8d1fc24ce3aeb9daef12
Charlie
*******
R#e9X2*
ae92df11b91a49ed34fd9a

Compare the separate salt and hash columns for each account. The table illustrates what is stored without showing the passwords. section 12.3.3

How Fundamentals of Cybersecurity covers it

How deep it goes
Explains password creation and validation at a workflow level, without specifying an implementation language or detailed procedure.
Examples
Uses two people choosing the same weak password and a table of accounts with separate salts and hashes.
What it assumes
Introduces salts and rainbow tables directly while relying on a basic understanding that passwords can be hashed.
What you can do after
Evaluate/understand it by distinguishing salted password hashes from hashes vulnerable to precomputed rainbow-table lookup.
How it connects
Connects salting to password hashing, rainbow tables, and password-database theft.

Also explained in

Compare how 6 books explain cryptographic salt →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fundamentals of Cybersecurity. The section links point to the parts of the book it draws on.