Salting

Salting adds a unique random value, called a salt, to each password before it is hashed, so identical passwords get different hashes and attackers can't crack many passwords at once with precomputed tables.

AdvancedCategory: Data protection, encryption and privacy

Also called: salt, password salt, salted hash

What is salting?

If two people use the same password and a system simply hashes it, both get the same hash. Attackers who steal the database can spot shared passwords and use huge precomputed lists of hashes, known as rainbow tables, to look up common passwords instantly. A salt fixes that: a random value, unique to each user, is added to the password before hashing and stored alongside the hash.

How salting works

  1. When a user sets a password, the system generates a random salt.
  2. It hashes the salt and password together, using a slow password-hashing algorithm.
  3. It stores the salt and the resulting hash.
  4. At login, it combines the stored salt with what the user typed, hashes it, and compares.

Because every hash uses a different salt, precomputed tables are useless and each password must be attacked individually.

What good password storage looks like

NIST requires passwords to be salted and hashed with a suitable one-way key derivation function. OWASP recommends algorithms designed to be slow, such as Argon2id, scrypt or bcrypt, so each guess takes real effort. Some systems also add a "pepper", a secret value stored separately from the database.

Why it matters for businesses

If you build or buy software that stores customer or staff passwords, ask how they're stored. Plain text, unsalted hashes or fast algorithms like MD5 turn any data breach into a mass password leak. Better still, use single sign-on or passkeys so the app doesn't store passwords at all.

Related terms

Sources

  1. SP 800-63B-4: Digital Identity Guidelines, Authentication and Authenticator Management (NIST)
  2. Password Storage Cheat Sheet (OWASP)

Drafted with AI assistance, then edited and fact-checked by a person. How we use AI.