Pcornel
Security · Hashing

Password Hashing

Cheat sheet · https://pcornel.dk/topic.php?topic=4713

Back to the Topic

Answer

Password hashing stores passwords with a slow, salted algorithm — Argon2id, bcrypt, scrypt or PBKDF2 — so stolen hash databases are expensive to crack. Fast hashes like SHA-256 alone are unsuitable.

Remember

  • Use slow, salted algorithms.
  • Never plain or fast hashes.
  • Upgrade old hashes at login.

First checks

  • grep <user> /etc/shadow | cut -d: -f2 | cut -c1-3 — algorithm prefix
  • App password storage (Argon2id/bcrypt/scrypt) — review
  • Cost parameters — tuned

Verify in this order

password + salt + cost → KDF → hash

Where it usually breaks

First mismatch in key/secret generation → storage/rotation → trust/certificate validation → protocol negotiation → cryptographic operation → peer/application verification; preserve identity/policy/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4713

Confirmation

Confirm action

Continue?