A cryptographic salt is a random value combined with a password before hashing. Generating a fresh salt for every password makes identical passwords produce different hashes and limits a stolen salt's compromise to its associated password. section 7.2.2
Salted password storage in PostgreSQL
With pgcrypto enabled, create an account by combining the password with a Blowfish salt: INSERT INTO accounts (username, password_hash) VALUES ('ahamilton', crypt('SuperSecret123', gen_salt('bf'))); The resulting hash includes the salt. During login, pass the entered password and stored hash to crypt(); it extracts the stored salt and returns a matching row only when the password is correct.
Practical properties:
- Generate a new random salt for every new password; avoid one fixed salt for all accounts. section 7.2.2




