If a password database is stolen, attackers can try to guess passwords offline. Salting and peppering can make that attack harder, but they solve different problems.
Salting: a unique value for each password
A salt is a random value added to a password before it is processed by a password-hashing algorithm. Each password gets its own salt, and the salt is stored alongside the resulting hash.
The salt makes identical passwords produce different stored hashes. It also prevents attackers from efficiently reusing precomputed tables of password hashes. A salt does not need to be secret.
Use a password-hashing algorithm designed to slow down guessing, such as Argon2id, with suitable parameters. A fast general-purpose hash such as SHA-256 is not a substitute.
Peppering: a secret kept outside the database
A pepper is a secret value used in addition to the password and salt.…