

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Encrypting Data at Rest
incomplete
2: Key Management and Rotation
incomplete
3: Password KDFs
incomplete
4: Salts
incomplete
5: Argon2 Parameters
incomplete
6: Encrypted Files
incomplete
7: Secure Database Practices
incomplete
8: Personally Identifiable Information
incomplete
9: Financial Data
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Two people should be allowed to choose the same password, but they should not end up with the same stored hash.
Without a salt, identical passwords produce identical hashes. A database leak would show which accounts share a password and let an attacker reuse the same precomputed guesses against every matching row.
A salt is random data mixed into one password-hashing operation. It doesn't need to be secret, but it should be unique and unpredictable. Luckily, the argon2 library generates a random salt and stores it inside the encoded hash:
$argon2id$v=19$m=19456,t=2,p=1$<salt>$<hash>
That single string contains everything verification needs:
Don't add a salt database column or concatenate one into the password yourself! Good KDF libraries own the format, salt generation, and verification rules and store everything in a single encoded string.