User Authentication and Passwords
Context: Information Security and Cryptography Β· authenticating a human to a system (login) β distinct from certificate-based machine authentication Β· the first step of Access Control
Quick Revision
- π― Objective: prove who wants access β at login (who may use the system) and again for critical transactions (re-check); the answer feeds Access Control.
- β‘ Key Constraint: never store passwords in cleartext; a plain hash is still beaten by rainbow tables, so the exam-critical answer is a per-user salted hash.
π Authentication factors
- Three factor types β something you know (password, PIN) Β· something you have (phone, hardware token) Β· something you are / other (fingerprint, location).
- Passwords dominate β still the most common mechanism despite known weaknesses.
- Two moments β identify at login (who can use the computer/app) + authenticate particular transactions (re-check for critical actions, e.g. bank transfers).
β οΈ Problems with passwords
- Reuse β one breach cascades across sites.
- Weak passwords β guessable / brute-forceable.
- Theft β phishing or malware capture them.
- Stored passwords β a leaked password database exposes everyone if stored badly.
- Usability β hard to remember β weak reset processes become the attack surface.
π Storing passwords safely
- Cleartext β β never β a database leak hands over every account.
- Plain hash (Cryptographic Hash Functions) β better (one-way), but attackers precompute rainbow tables (hash β password lookups) and can test guesses.
- Salted hash β β add a unique random salt per user before hashing β identical passwords get different hashes, defeating rainbow tables and forcing per-account brute force.
- Where it lives β the OS checks the password at login inside kernel mode (see user vs kernel mode); access control + process separation protect the stored hashes from user processes.
β οΈ Common Mistakes
- π‘ Salt β secret β the salt need not be secret; its job is to be unique per user so precomputed tables donβt apply β not to hide.
- π‘ Hashing β encryption β password hashes are not decrypted on login; the system re-hashes the entered password (with the stored salt) and compares digests.
π§ Active Recall
Passwords are hashed, so why add a salt β isn't a secure hash already irreversible?
Answer
- Short answer: an unsalted hash is deterministic, so attackers precompute rainbow tables once and instantly reverse every matching hash, and identical passwords share a hash. A per-user salt makes each hash unique, so those tables and cross-account shortcuts fail.
- Why: Forced per-account work β salting means an attacker must brute-force each account separately with its own salt, hugely raising cost even for a leaked database.