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