Security

What is Salting?

Adding a unique random value to each password before hashing, defeating rainbow tables and hiding duplicate passwords.

Definition

A salt is a unique random value generated per password and combined with it before hashing, then stored alongside the hash. Because two users with the password "hunter2" get different salts, their stored hashes differ — an attacker who breaches the database cannot spot shared passwords or use precomputed rainbow tables, and must attack each hash individually. Salts are not secrets; their power is uniqueness. Modern password hashing functions like bcrypt and Argon2 generate and embed the salt automatically, so applications using them correctly never handle salts by hand. A related server-side secret, the pepper, is stored outside the database for extra defense.

Related Terms

Keep the references coming

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.