Concept - Password Hashing and Salt
Salt: a value combined with the password before hashing. Why (s.13): prevents duplicate passwords from being visible in the file; increases the difficulty of offline dictionary attacks; makes it nearly impossible to tell if a person used the same password on multiple systems.
Flow (s.12): loading = salt (12 bits) + password (56 bits) into crypt(3), 11-character output stored in the Password File next to User id and salt. Verifying = select row by User id, take its salt, hash the entered password with it, compare with the stored output.
| Scheme | Salt | Hash |
|---|---|---|
UNIX original Crypt(3) (modified DES, up to 8 characters = 56-bit key) (s.14) | 12-bit | 11-character output; “woefully insecure” |
| MD5 (s.15) | 48-bit | 128-bit hash, 1000 times inner loop, unlimited password length; MD5 has “extensive vulnerabilities” |
| Bcrypt, OpenBSD (Blowfish-based) (s.15) | 128-bit | 192-bit hash; “most secure” |
Example: two users with the same password get different stored values because their salts differ (follows from s.13).
Related: Concept - Password Cracking, Concept - Password File Access Control. Appears in 03 User Authentication - Chunk 01 (s.1-33).