Password Hashing
- •
def
- •
the practice of storing passwords as hash digests rather than in encrypted (reversible) form
- •
- •
why hashing instead of encryption
- •
encrypting passwords requires storing a decryption key somewhere on the system; if an attacker compromises the system, they can find that key and decrypt everyone's password
- •
hashing avoids this — the system only ever stores the resulting digest, never the original password, so there is no key to steal that would reveal the password itself
- •
- •
- •
example (Linux)
- •
on Linux, passwords are not stored in
/etc/passwd(that file just has anxplaceholder); the actual salted hash digest is stored in/etc/shadow, which only privileged/root users can read - •
a
/etc/shadowentry like$y$...records which hashing algorithm was used (y= SHA-512), followed by the salt and the resulting hash value
- •
- •
- •