Tutorial 3.3: Password-Based Authentication
Learning Objectives
After completing this tutorial, you should be able to:
- Explain the role of passwords in the authentication process and their historical significance.
- Analyze the vulnerabilities and threats associated with password-based authentication, including phishing, password reuse, and credential stuffing.
- Evaluate secure password storage mechanisms, including hashing, salting, and key derivation functions.
- Compare password cracking techniques, including dictionary attacks, brute-force, and rainbow tables.
- Design effective password policies that balance security and usability.
- Assess the benefits and limitations of password managers and alternative authentication methods.
- Describe real-world password breaches and their implications.
- Implement a password hashing scheme using industry-standard algorithms.
Overview
Passwords remain the most widely used authentication mechanism despite decades of demonstrated vulnerabilities. The
appeal of passwords is clear: they are simple, familiar, cost-effective, and require no special hardware. However,
password-based authentication is also one of the weakest links in security chains, responsible for over 80% of data breaches
involving human error or credential compromise.
In this tutorial, we examine password-based authentication from multiple perspectives: its theoretical underpinnings,
its vulnerabilities, the threat landscape, and the defensive measures that organizations and individuals can employ. We
begin by exploring the essential role of passwords and why they have persisted despite their known weaknesses. We then
analyze the primary threats to password security—including phishing, password reuse, credential stuffing, and offline
cracking—and discuss how each threat exploits specific weaknesses in password design and deployment.
The bulk of the tutorial focuses on password storage and verification. We cover the evolution of password storage from
plaintext to hashed and salted passwords, and we discuss modern key derivation functions (KDFs) such as bcrypt, PBKDF2,
and Argon2. We also examine password cracking techniques—dictionary attacks, brute-force attacks, and the use of rainbow
tables—and how defenders can mitigate these attacks through proper password policies and storage practices.
We also address password policies: what constitutes a strong password policy, how to balance security with usability,
and the role of password expiry and complexity requirements. We explore the use of password managers as a solution to
password fatigue and reuse, and we discuss the emerging trend toward passwordless authentication as a potential
replacement for traditional passwords.
The tutorial concludes with two case studies: one examining the 2012 LinkedIn password breach (which exposed 6.5 million
unsalted SHA-1 hashes) and another analyzing the effectiveness of password policies in a large enterprise. These case
studies illustrate the practical implications of the concepts covered in this tutorial and provide lessons for real-world
password security.
1. The Role of Passwords in Authentication
1.1 Historical Context
Passwords have been used for authentication since the early days of computing. In the 1960s, MIT's Compatible Time-Sharing
System (CTSS) introduced the concept of a password to protect user files. Since then, passwords have become the de facto
standard for authentication across virtually all digital systems.
The persistence of passwords despite their known weaknesses can be attributed to several factors:
- Simplicity: Passwords are easy to implement and require no specialized hardware.
- Familiarity: Users have decades of experience with passwords.
- Cost-effectiveness: Password-based authentication is inexpensive to deploy and maintain.
- Compatibility: Passwords work with nearly all systems and protocols.
- Inertia: Changing the authentication paradigm is disruptive and expensive.
1.2 How Password Authentication Works
The basic flow of password authentication is straightforward:
- The user presents their username (identification) and password (authentication factor).
- The system looks up the user's stored password (or password hash).
- The system compares the presented password with the stored value.
- If they match, the user is authenticated; otherwise, access is denied.
In modern systems, passwords are never stored in plaintext. Instead, a cryptographic hash of the password is stored, and
the verification process involves hashing the presented password and comparing the hashes. This protects the password
even if the password database is compromised.
┌─────────────────────────────────────────────────────────────────────────────┐
│ PASSWORD AUTHENTICATION FLOW │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────┐ 1. Username + Password ┌─────────────────┐ │
│ │ User │────────────────────────────► Authentication │ │
│ │ │ │ Service │ │
│ └────────────┘ └────────┬────────┘ │
│ │ │
│ │ 2. Look up password │
│ │ hash (or verify │
│ │ against stored) │
│ │ │
│ ┌──────┴──────┐ │
│ │ Password │ │
│ │ Database │ │
│ │ (hashed) │ │
│ └─────────────┘ │
│ │ │
│ 3. Match? │
│ │ │
│ ┌──────┴──────┐ │
│ │ Permit / │ │
│ │ Deny │ │
│ └─────────────┘ │
│ │ │
│ 4. Access Granted / Denied │ │
│ ┌────────────┐◄──────────────────────────────────┘ │
│ │ User │ │
│ └────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
Figure 1: The password authentication flow.
Key Takeaway: Passwords are the most widely used authentication factor due to their simplicity and cost-effectiveness.
However, their prevalence also makes them a primary target for attackers, and they must be protected through secure storage
and robust policies.
2. Password Vulnerabilities and Threats
2.1 Human Factors
The human element is often the weakest link in password security. Common human-related vulnerabilities include:
- Password reuse: Users often reuse passwords across multiple accounts. A breach of one service can
compromise all accounts that share the same password.
- Weak passwords: Many users choose passwords that are easy to guess, such as "password," "123456," or
common dictionary words.
- Writing down passwords: Users write passwords on sticky notes or store them in unsecured documents,
creating a physical security risk.
- Password fatigue: Users who must remember many complex passwords may adopt poor security practices,
such as recycling passwords or using simple patterns.
- Social engineering: Attackers can trick users into revealing their passwords through phishing,
pretexting, or baiting.
2.2 Technical Threats
Beyond human factors, password systems face a range of technical threats:
| Threat |
Description |
Impact |
| Phishing |
Attackers impersonate legitimate entities to steal credentials. |
Credential theft, unauthorized access. |
| Credential Stuffing |
Attackers use stolen credentials from one service to access other services. |
Account takeover, data breach. |
| Brute-Force Attacks |
Attackers systematically try all possible password combinations. |
Password guessing; mitigated by rate limiting and lockout. |
| Dictionary Attacks |
Attackers use lists of common passwords to guess credentials. |
Compromise of accounts with weak passwords. |
| Man-in-the-Middle (MitM) |
Attackers intercept authentication traffic to capture credentials. |
Credential interception; mitigated by encryption. |
| Keylogging |
Malware records keystrokes to capture passwords. |
Credential theft; mitigated by endpoint security. |
| Database Breach |
Attackers gain access to the password database. |
Massive credential exposure; protected by hashing and salting. |
2.3 The Password Reuse Problem
Password reuse is one of the most significant risks in password-based authentication. Studies indicate that the average
user reuses the same password across more than ten different accounts. This means that a breach of one service can lead
to a "domino effect" where attackers use the same credentials to compromise other accounts.
The 2021 Verizon Data Breach Investigations Report found that 61% of breaches involved stolen credentials. Attackers often
obtain credentials from data breaches of third-party services and then use them in credential-stuffing attacks against
other services. This highlights the importance of unique passwords for each account and the use of multi-factor
authentication (MFA).
Warning: The combined threat of password reuse, weak passwords, and database breaches makes password-based
authentication inherently vulnerable. Organizations should treat password-based authentication as a baseline and layer
additional security controls (such as MFA and behavioral monitoring) to compensate for these vulnerabilities.
3. Password Storage: Hashing and Salting
3.1 Secure Password Storage Principles
Passwords must never be stored in plaintext. The fundamental principles of secure password storage are:
- One-way hashing: Passwords should be stored as cryptographic hashes that cannot be reversed.
- Salting: A unique random value (salt) should be added to each password before hashing to prevent
precomputation attacks.
- Key stretching: Password hashing should be deliberately slow to make brute-force attacks impractical.
- Secure algorithms: Use modern, well-vetted hashing algorithms designed for password storage.
3.2 Hashing Algorithms
A cryptographic hash function takes an input (the password) and produces a fixed-size output (the hash). The key properties
of a secure hash function include:
- Preimage resistance: It is computationally infeasible to find an input that produces a given hash.
- Second preimage resistance: It is infeasible to find a different input that produces the same hash as
a given input.
- Collision resistance: It is infeasible to find two different inputs that produce the same hash.
Historically, hash functions like MD5 and SHA-1 were used for password storage, but they are now considered broken or
inadequate due to collision attacks and the availability of fast hardware. Modern password hashing uses algorithms designed
specifically for password storage.
3.3 Key Derivation Functions (KDFs)
Key Derivation Functions are hash functions designed for password storage. They incorporate two key features:
- Work factor (iteration count): The number of times the hash function is applied, making the hash
computation computationally expensive.
- Memory hardness: Some KDFs require significant memory to compute, making them resistant to GPU and
ASIC-based attacks.
The most widely recommended KDFs for password storage are:
- bcrypt: Based on the Blowfish cipher, incorporates a work factor (cost) and a salt. Widely used and
well-tested.
- PBKDF2 (Password-Based Key Derivation Function 2): Uses a pseudorandom function (e.g., HMAC-SHA256)
with a salt and iteration count. Recommended by NIST.
- Argon2: Winner of the Password Hashing Competition (2015). Offers configurable memory, time, and
parallelism parameters.
Example of bcrypt hashing (pseudocode):
# Create a bcrypt hash with cost factor 12
salt = generate_random_salt(16)
hash = bcrypt_hash(password, salt, cost=12)
# Store hash (includes salt and cost factor)
store_in_database(username, hash)
3.4 Salting
A salt is a random value that is unique to each password. The salt is concatenated with the password
before hashing, ensuring that two identical passwords produce different hashes. Salting provides two critical benefits:
- Defeats rainbow tables: Precomputed hash tables (rainbow tables) are ineffective because each
password has a unique salt.
- Prevents duplicate hashes: Even if two users choose the same password, their hashes will be different
due to the unique salt.
The salt must be stored alongside the hash, typically as part of the same string (e.g., in bcrypt, the salt is embedded
in the hash string).
3.5 Comparison of Password Storage Methods
| Method |
Security |
Performance |
Resistance to Cracking |
Notes |
| Plaintext |
None |
Very fast |
None |
Never use. |
| MD5 (unsalted) |
Weak |
Fast |
Low |
Broken; vulnerable to collision attacks and rainbow tables. |
| SHA-1 (salted) |
Moderate |
Fast |
Low (fast hashing) |
Deprecated; SHA-1 is no longer considered secure. |
| SHA-256 (salted) |
Moderate |
Fast |
Low (fast hashing) |
Better than SHA-1, but still fast and vulnerable to brute-force on modern hardware. |
| bcrypt (cost=10) |
High |
Slow |
High |
Well-tested; widely used; cost factor adjustable. |
| PBKDF2 (100k iterations) |
High |
Slow |
High |
NIST recommended; uses HMAC. |
| Argon2id |
Very high |
Slow, memory-hard |
Very high |
Winner of PHC; highly configurable. |
Key Takeaway: Secure password storage requires hashing with a salt and a key derivation function that
is deliberately slow and, ideally, memory-hard. Algorithms like bcrypt, PBKDF2, and Argon2 are the current industry
standards.
4. Password Cracking Techniques
4.1 Offline vs. Online Cracking
Password cracking can be classified into two broad categories:
- Online cracking: The attacker attempts to authenticate against a live system. Defenses such as
rate limiting, account lockout, and CAPTCHA make online cracking difficult.
- Offline cracking: The attacker obtains the password database (or hashes) and attempts to recover
passwords by computing hashes offline. This is much more effective and is the primary threat that password storage
mechanisms must defend against.
4.2 Dictionary Attacks
A dictionary attack uses a list of common passwords, dictionary words, and known password patterns. The attacker computes
the hash of each word in the dictionary and compares it to the target hash. Dictionary attacks are effective because many
users choose common, easily guessable passwords.
Example dictionary entries: password, 123456, qwerty, letmein,
monkey, dragon, etc.
4.3 Brute-Force Attacks
A brute-force attack tries every possible combination of characters up to a certain length. The time required for a
brute-force attack depends on:
- Password length: Each additional character exponentially increases the search space.
- Character set: Using a larger character set (e.g., lowercase + uppercase + digits + symbols)
increases the search space.
- Hashing speed: The faster the hash function, the more guesses per second the attacker can make.
For example, a password with 8 characters from a set of 95 printable ASCII characters has 958 ≈ 6.6 × 1015
possible combinations. With a modern GPU capable of billions of hashes per second, such a password could be cracked in
hours or days. This is why long, complex passwords are essential.
4.4 Rainbow Tables
A rainbow table is a precomputed table of hash values for a given character set and password length. By using a
space-time trade-off, rainbow tables allow attackers to quickly look up a hash and find the corresponding password.
Defense: Salting defeats rainbow tables. Since each password has a unique salt, the attacker would need
to build a separate rainbow table for each salt, which is computationally infeasible.
4.5 Hybrid Attacks
Hybrid attacks combine dictionary attacks with brute-force variations. Common patterns include:
- Adding numbers or symbols to dictionary words (e.g.,
password123).
- Capitalizing the first letter (e.g.,
Password).
- Replacing letters with similar-looking numbers (e.g.,
p@ssw0rd).
- Using known password patterns (e.g.,
Summer2024!).
4.6 Cracking Tools and Hardware
Password cracking tools such as John the Ripper, Hashcat, and Hydra are widely used by security professionals and
attackers alike. These tools leverage:
- GPUs: Graphics processing units can compute millions or billions of hashes per second.
- ASICs: Application-specific integrated circuits can be even faster but are less flexible.
- FPGAs: Field-programmable gate arrays offer a middle ground between speed and flexibility.
- Cloud computing: Attackers can rent GPU instances in the cloud to crack passwords at scale.
Implication: The increasing power of hardware means that even moderate-strength passwords can be
cracked quickly if they are hashed with fast algorithms (like SHA-1) and not properly salted. This underscores the
importance of using slow, memory-hard KDFs and enforcing strong password policies.
5. Password Policies and Best Practices
5.1 What Is a Password Policy?
A password policy is a set of rules designed to encourage strong password selection and secure password
management. Password policies are a critical control for reducing the risk of password-based attacks.
5.2 NIST Password Guidelines
The NIST Digital Identity Guidelines (SP 800-63B) provide authoritative guidance on password policies.
Key recommendations include:
- Password length: Encourage long passwords (8–64 characters). NIST recommends a minimum of 8 characters,
but longer passwords are preferred.
- Complexity rules: Do not enforce arbitrary complexity rules (e.g., "must contain uppercase, lowercase,
number, and symbol"). Such rules often lead to predictable patterns and user frustration.
- Password expiry: Do not force regular password changes unless there is evidence of compromise.
Frequent password changes lead to weaker passwords and user fatigue.
- Blacklist: Maintain a blacklist of commonly used, weak, or compromised passwords (e.g.,
password,
123456).
- Breach detection: Monitor for compromised passwords using breach databases (e.g., Have I Been Pwned).
- Lockout: Implement account lockout after a small number of failed attempts (e.g., 5–10 attempts).
- MFA: Require multi-factor authentication for all users.
5.3 Password Strength Metrics
Password strength is a measure of the difficulty of guessing or cracking a password. It is typically measured in terms of
entropy—the number of possible combinations—usually expressed in bits.
- Entropy (bits): H = log2(N), where N is the number of possible password combinations.
- Example: A password of length 8 using only lowercase letters (26 characters) has entropy
log2(268) ≈ 37.6 bits. A password of length 8 using 95 printable ASCII characters has entropy
log2(958) ≈ 52.6 bits.
Modern best practice recommends a password with at least 64–80 bits of entropy. This translates to:
- A random password of 12–14 characters from a 95-character set.
- A passphrase of 4–6 random words (e.g., "correct horse battery staple") with 40–60 bits of entropy.
5.4 Passphrases vs. Passwords
A passphrase is a sequence of multiple words, often with spaces. Passphrases are typically longer than
traditional passwords but easier to remember. A well-chosen passphrase (e.g., "blue sky above green hills") can have
high entropy and is resistant to dictionary attacks, especially when combined with random word selection.
5.5 Practical Password Policy Recommendations
- Minimum length: 12 characters.
- Maximum length: 64 characters (or more) to accommodate passphrases.
- Character set: Encourage use of uppercase, lowercase, numbers, and symbols, but do not enforce
arbitrary combinations.
- Blacklist: Reject the top 100,000 most common passwords and any passwords found in breach databases.
- MFA: Require MFA for all accounts, especially privileged accounts.
- No password expiry: Do not force periodic password changes unless there is a specific reason
(e.g., suspected compromise).
- Single sign-on (SSO): Use SSO to reduce the number of passwords users must remember.
- Password managers: Encourage users to use password managers to generate and store strong, unique
passwords.
Key Takeaway: Modern password policies should prioritize password length, blacklist weak passwords,
and avoid arbitrary complexity rules. NIST recommends against mandatory password expiry and encourages the use of
MFA and password managers.
6. Password Managers and Alternatives
6.1 Password Managers
A password manager is a software application that stores, generates, and manages passwords for the user.
Password managers are a key tool for addressing password fatigue and password reuse.
Benefits of password managers:
- Generate strong, random passwords: Password managers can create long, complex passwords that are
difficult to crack.
- Unique passwords per site: Users can have a different password for every service, limiting the impact
of a breach.
- Autofill: Passwords are automatically entered, reducing the risk of phishing and keylogging.
- Encrypted storage: Passwords are stored in an encrypted vault that requires a master password to unlock.
- Cross-device synchronization: Many password managers sync across devices, making them convenient
and accessible.
Popular password managers include: 1Password, Bitwarden, Dashlane, KeePass, and LastPass.
6.2 Passwordless Authentication
Passwordless authentication is an emerging paradigm that eliminates passwords altogether, replacing
them with more secure authentication methods. Common passwordless approaches include:
- Biometrics: Fingerprint, facial recognition, iris scan.
- Hardware tokens: FIDO2 security keys that use public-key cryptography.
- Magic links: Email-based login links that provide one-time access.
- One-time passwords (OTP): Using TOTP or HOTP as the primary authentication factor (with a backup
factor for account recovery).
- Push notifications: Authentication via a mobile app that sends a push notification for approval.
6.3 The Future of Authentication
While passwords are unlikely to disappear overnight, the trend is clearly toward stronger, more user-friendly
authentication methods. The FIDO Alliance's WebAuthn and CTAP standards are driving adoption of passwordless
authentication on the web and mobile platforms. Organizations are increasingly adopting passwordless authentication
for employees and customers to improve security and user experience.
However, passwordless authentication is not a silver bullet. It introduces new challenges, such as:
- Biometric privacy: Biometric data must be securely stored and protected.
- Account recovery: How do users recover their accounts if they lose their device or biometric
changes?
- Hardware cost: Security keys and biometric sensors have a cost.
- User adoption: Users may be reluctant to adopt new authentication methods.
Practical Advice: For most organizations, a combination of password-based authentication with MFA and
password managers is a pragmatic, secure approach. As passwordless authentication matures, organizations should consider
piloting it for high-risk users and gradually expanding adoption.
7. Case Studies
7.1 Case Study: LinkedIn Password Breach (2012)
Background: In June 2012, LinkedIn announced that 6.5 million user passwords had been stolen and posted
online. The breach was a wake-up call for the industry.
Technical details:
- The stolen hashes were generated using SHA-1.
- No salt was used. This meant that identical passwords produced identical hashes, making it easy to
spot common passwords.
- Attackers were able to crack many of the hashes using dictionary attacks and brute-force techniques, leveraging the
speed of SHA-1.
- Within days, over 90% of the hashes were cracked.
Lessons learned:
- Always use a salt and a slow, memory-hard KDF (e.g., bcrypt, Argon2).
- SHA-1 is not suitable for password hashing due to its speed and collision vulnerabilities.
- Breach detection and notification are critical—LinkedIn was criticized for not detecting the breach for days.
- Users with compromised passwords should be forced to reset them and adopt MFA.
7.2 Case Study: Enterprise Password Policy Implementation
Background: A large financial institution with 30,000 employees implemented a new password policy aligned
with NIST SP 800-63B.
Old policy:
- 8-character minimum.
- Complexity: uppercase, lowercase, number, and symbol required.
- 90-day password expiry.
- No password history check (users could reuse previous passwords).
- Lockout after 5 failed attempts.
New policy (NIST-aligned):
- 12-character minimum.
- No arbitrary complexity rules; encourage passphrases.
- No password expiry (unless compromise is suspected).
- Blacklist of 100,000 common passwords (updated with breach data).
- Lockout after 10 failed attempts.
- MFA required for all users (password + TOTP).
- Password managers encouraged and provided by IT.
Outcome:
- Helpdesk password reset tickets dropped by 45% within six months.
- User satisfaction improved (fewer complexity rules, less frequent password changes).
- Security posture improved: no successful password-based attacks were reported in the following year.
- Breach detection via blacklist and compromised password checks prevented several credential-stuffing attacks.
8. Summary and Transition
In this tutorial, we examined password-based authentication, the most common but also one of the most vulnerable
authentication mechanisms. We explored the human and technical vulnerabilities that make passwords a persistent security
challenge, including password reuse, weak passwords, phishing, credential stuffing, and offline cracking.
We covered secure password storage in depth, discussing the evolution from plaintext to hashed and salted passwords, and
the use of key derivation functions like bcrypt, PBKDF2, and Argon2. We also examined password cracking techniques,
including dictionary attacks, brute-force attacks, and rainbow tables, and the importance of using slow, memory-hard
algorithms to mitigate offline cracking.
Password policies were discussed in the context of NIST SP 800-63B, with recommendations to prioritize length, avoid
arbitrary complexity, eliminate mandatory password expiry, and enforce MFA. We also explored the role of password
managers in addressing password fatigue and password reuse, and the emerging trend of passwordless authentication.
Two case studies—the LinkedIn breach and an enterprise password policy implementation—illustrated the practical
implications of password security and the effectiveness of modern password policies.
This tutorial has provided a comprehensive understanding of password-based authentication, its strengths, weaknesses,
and defenses. In the next tutorial, Tutorial 3.4, we will extend this foundation by exploring multi-factor
authentication (MFA) and other authentication technologies, including one-time passwords, hardware tokens,
and adaptive authentication.
Quiz
Answer the following questions to check your understanding. Click the "Answer" button to reveal the solution.
Q1. What is the primary purpose of salting a password before hashing?
- A) To make the hash faster to compute
- B) To defeat rainbow table attacks and prevent duplicate hashes
- C) To encrypt the password for storage
- D) To reduce the password length
Answer
B) Salting defeats rainbow table attacks and prevents duplicate hashes for identical passwords.
Q2. Which of the following is a recommended password hashing algorithm according to NIST?
- A) MD5
- B) SHA-1
- C) PBKDF2
- D) DES
Answer
C) PBKDF2 is recommended by NIST for password hashing.
Q3. Which of the following is not a recommended practice in NIST SP 800-63B password guidelines?
- A) Require MFA
- B) Enforce mandatory password expiry every 90 days
- C) Maintain a blacklist of common passwords
- D) Encourage passwords of at least 8 characters
Answer
B) NIST does not recommend mandatory password expiry unless there is evidence of compromise.
Q4. A dictionary attack is a type of password cracking that:
- A) Tries every possible combination of characters
- B) Uses a list of common passwords and dictionary words
- C) Relies on precomputed hash tables
- D) Uses social engineering to obtain passwords
Answer
B) A dictionary attack uses a list of common passwords and dictionary words.
Q5. What is the primary advantage of using a password manager?
- A) It eliminates the need for a master password
- B) It generates and stores strong, unique passwords for each account
- C) It provides hardware-based authentication
- D) It stores passwords in plaintext for easy access
Answer
B) Password managers generate and store strong, unique passwords for each account.
Q6. Which of the following is a memory-hard key derivation function?
- A) SHA-256
- B) MD5
- C) Argon2
- D) AES
Answer
C) Argon2 is a memory-hard key derivation function.
Q7. Credential stuffing is an attack that:
- A) Uses a dictionary of common words to guess passwords
- B) Uses stolen credentials from one service to access other services
- C) Intercepts authentication traffic to capture credentials
- D) Precomputes hash values for password cracking
Answer
B) Credential stuffing uses stolen credentials from one service to access other services.
Q8. What is the role of a work factor (iteration count) in a key derivation function?
- A) To increase the length of the hash output
- B) To make the hash computation slower, reducing brute-force efficiency
- C) To add randomness to the hash
- D) To compress the password
Answer
B) The work factor makes the hash computation slower, reducing the efficiency of brute-force attacks.
Q9. Which of the following is a characteristic of a strong password?
- A) It is short and easy to remember
- B) It uses a common dictionary word
- C) It is long and includes a mix of character types
- D) It is the same as the username
Answer
C) A strong password is long and includes a mix of character types (uppercase, lowercase, numbers, symbols).
Q10. What was the primary weakness in LinkedIn's password storage in the 2012 breach?
- A) Passwords were stored in plaintext
- B) Passwords were hashed with MD5
- C) Passwords were hashed with SHA-1 without salt
- D) Passwords were encrypted with AES
Answer
C) The passwords were hashed with SHA-1 without salt, making them vulnerable to dictionary attacks and rainbow tables.
Q11. A passphrase is typically:
- A) A short, random sequence of characters
- B) A sequence of multiple words, often with spaces
- C) A single dictionary word with numbers added
- D) A password stored in a password manager
Answer
B) A passphrase is a sequence of multiple words, often with spaces, making it easier to remember than a complex password.
Q12. Which of the following is a defense against rainbow table attacks?
- A) Using a fast hash function
- B) Using a salt
- C) Using a short password
- D) Using a dictionary word
Answer
B) A salt defeats rainbow tables by making precomputation infeasible.
Exercises
These exercises are designed to help you apply the concepts from this tutorial. Attempt each exercise before revealing the sample solution.
Exercise 3.3-1: Hash Comparison
You are tasked with selecting a password hashing algorithm for a new application. Compare bcrypt (cost=10), PBKDF2 (100,000 iterations), and SHA-256 (salted). For each algorithm, analyze:
- Security strengths and weaknesses.
- Performance characteristics and scalability.
- Resistance to GPU-based cracking.
- Resistance to memory-based attacks.
- Which algorithm would you recommend for a high-security enterprise application, and why?
Sample Solution
- bcrypt (cost=10): Strengths: well-tested, incorporates salt, adjustable work factor. Weaknesses: not memory-hard, but resistant to GPU due to algorithm design. Performance: moderate (a few hundred hashes per second on a CPU). Scalability: good, but cost factor should be chosen carefully. Recommendation: recommended for most applications due to maturity and security.
- PBKDF2 (100k iterations): Strengths: NIST recommended, uses HMAC, adjustable iterations. Weaknesses: not memory-hard, vulnerable to GPU acceleration. Performance: can be made slower by increasing iterations, but GPUs can still be effective. Scalability: good, but iteration count must be high enough for security. Recommendation: acceptable, but bcrypt or Argon2 are preferred.
- SHA-256 (salted): Strengths: fast, widely supported. Weaknesses: too fast, vulnerable to GPU/ASIC attacks. Not designed for password storage. Performance: very fast (millions of hashes per second). Scalability: high, but that's a disadvantage. Recommendation: not recommended for password storage.
- Recommendation: For a high-security enterprise application, choose bcrypt (cost 12 or higher) or Argon2id. Both offer strong resistance to cracking. Argon2 is more modern and memory-hard, but bcrypt is more widely supported and tested.
Exercise 3.3-2: Password Policy Design
Design a password policy for a university with 20,000 students and 5,000 faculty/staff. The university uses a centralized identity system that supports MFA. The policy should be aligned with NIST SP 800-63B and address:
- Password length, character set, and complexity requirements.
- Password expiry and history requirements.
- Lockout and rate-limiting policies.
- Blacklist and breach detection.
- MFA requirements.
- How the policy will be communicated and enforced.
- How the university will handle password resets and account recovery.
Sample Solution
- Length and complexity: Minimum 12 characters, no arbitrary complexity rules (e.g., "must have uppercase" not required). Encourage passphrases.
- Expiry and history: No mandatory expiry. Password history of 5 passwords to prevent reuse.
- Lockout: Lockout after 8 failed attempts, with 15-minute duration.
- Blacklist: Block the top 100,000 common passwords. Integrate with Have I Been Pwned API to check against breach data.
- MFA: MFA required for all users. Faculty and staff must use hardware tokens or TOTP; students may use TOTP or SMS (with appropriate risk controls).
- Communication: Policy published on the IT portal, included in new student and employee orientation, and reinforced through regular security awareness training.
- Reset and recovery: Self-service password reset with MFA verification. For account recovery, a multi-step verification process using secondary email, security questions (with unique, non-public answers), and IT helpdesk assistance with identification.
Exercise 3.3-3: Password Cracking Resistance
Calculate the approximate time to crack a password using brute force on a system that can compute 10 billion (10^10) hashes per second. Assume the password uses a character set of 95 printable ASCII characters.
- For a password of length 8.
- For a password of length 12.
- For a password of length 16.
- What is the minimum length required to achieve an average cracking time of at least 1 billion years? (You may approximate and show your calculations.)
Sample Solution
Number of combinations: N = 95L, where L is the password length.
Average cracking time (guessing half the space): T = N / (2 * 10^10) seconds.
- Length 8: N = 958 ≈ 6.63 × 1015. T ≈ 6.63 × 1015 / (2 × 1010) ≈ 3.32 × 105 seconds ≈ 3.8 days.
- Length 12: N = 9512 ≈ 5.40 × 1023. T ≈ 5.40 × 1023 / (2 × 1010) ≈ 2.70 × 1013 seconds ≈ 8.56 × 105 years.
- Length 16: N = 9516 ≈ 4.40 × 1031. T ≈ 4.40 × 1031 / (2 × 1010) ≈ 2.20 × 1021 seconds ≈ 6.98 × 1013 years.
- Minimum length for 1 billion years: 1 billion years = 3.15 × 1016 seconds. We need N / (2 × 1010) ≥ 3.15 × 1016 → N ≥ 6.30 × 1026. 95L ≥ 6.30 × 1026. Taking log: L ≥ log(6.30 × 1026) / log(95) ≈ 13.5. So a length of 14 characters is sufficient.
Exercise 3.3-4: Phishing and Social Engineering
You are a security consultant for a mid-sized company. The company has experienced several successful phishing attacks that led to credential theft and account compromise. Employees are not using MFA. Develop a comprehensive plan to address phishing risks, including:
- Technical controls (MFA, email filtering, etc.).
- User awareness training.
- Processes for reporting and responding to suspected phishing.
- How to encourage the use of password managers.
- How to monitor for compromised credentials.
Sample Solution
- Technical controls: Deploy MFA for all users (password + TOTP or security key). Implement email filtering to block phishing emails. Use DMARC, SPF, and DKIM to prevent domain spoofing. Deploy endpoint protection with browser security extensions.
- User awareness training: Conduct regular phishing simulations with feedback. Provide training on recognizing phishing indicators (e.g., suspicious sender addresses, urgency, unexpected attachments). Make training mandatory and track completion.
- Reporting and response: Implement a "Report Phishing" button in email clients. Establish a clear process for employees to report suspicious emails. Have a dedicated incident response team to investigate reported emails and take down malicious sites.
- Password managers: Provide a corporate password manager (e.g., 1Password, Bitwarden) to all employees. Integrate it with SSO and enforce its use for corporate accounts. Offer training on how to use the password manager securely (e.g., master password strength, 2FA for the vault).
- Credential monitoring: Use a service like Have I Been Pwned to monitor for company email addresses in known breaches. Automatically alert users and require password changes if their credentials are found in a breach.
Exercise 3.3-5: Password Storage Migration
A legacy system currently stores passwords using unsalted MD5. The organization wants to migrate to a more secure password storage mechanism (bcrypt) without requiring all users to reset their passwords. Develop a migration strategy that ensures security and minimizes user disruption. Consider:
- How to handle existing passwords during the transition.
- How to update the authentication flow to support the new storage.
- How to handle password resets after the migration.
- How to test the migration to ensure no user is locked out.
Sample Solution
- Migration strategy: Use a "re-hashing" approach. When a user authenticates successfully (using the legacy MD5 verification), the system re-hashes their password using bcrypt and stores the new hash. The legacy MD5 hash can then be removed or retained as a fallback.
- Authentication flow: The authentication module first checks the bcrypt hash. If not present, it checks the legacy MD5 hash. If the legacy MD5 check succeeds, the system re-hashes with bcrypt and updates the user record.
- Password resets: After migration, all password resets use the new bcrypt hash. The old MD5 hash is removed upon reset.
- Testing: Conduct a phased rollout: first on a test environment, then with a small group of users, and finally all users. Monitor authentication logs for failures and have a rollback plan.
- Additional security: Once all users have migrated (after a sufficient period, e.g., 90 days), disable the legacy MD5 verification and remove all MD5 hashes.
Homework
These homework questions require deeper analysis, research, and application. Answer each question comprehensively.
Homework 3.3-1: Password Attack Analysis
Analyze a real-world password breach (e.g., Dropbox 2012, LinkedIn 2012, Adobe 2013, Yahoo 2013, or a more recent breach). Write a 750–1,000 word analysis that includes:
- A description of the breach and the passwords exposed.
- The password storage mechanism used (if known).
- How attackers were able to crack the passwords.
- The impact of the breach on users and the organization.
- What the organization could have done differently to prevent or mitigate the breach.
- Lessons learned for password security.
Sample Answer
Note: This is a research assignment. The sample answer below provides an outline and direction. Students are expected to produce a full paper.
Sample Outline: Adobe 2013 Breach
- Background: In October 2013, Adobe announced a massive breach affecting 38 million users. The breach exposed customer IDs, encrypted passwords, and credit card data.
- Password storage: Adobe used a combination of Triple DES (3DES) encryption for passwords, not hashing. The encryption key was later discovered, making decryption trivial.
- Cracking method: Attackers decrypted the passwords and, in some cases, cracked them using dictionary attacks.
- Impact: Millions of users had their credentials exposed; many reused passwords, leading to further compromises.
- What Adobe could have done: Use salted bcrypt or PBKDF2 instead of encryption. Implement MFA. Monitor for data exfiltration.
- Lessons learned: Never store passwords with reversible encryption. Use slow, salted hashing. Encourage users to use unique passwords.
Homework 3.3-2: Passwordless Authentication Research
Research passwordless authentication technologies. Write a 1,000–1,250 word analysis that:
- Describes the technologies and standards (FIDO2, WebAuthn, CTAP, biometrics, magic links, etc.).
- Compares passwordless authentication to traditional password-based authentication in terms of security, usability, and cost.
- Discusses the challenges and barriers to adoption (technical, organizational, and user-related).
- Evaluates the potential for passwordless authentication to replace passwords in enterprise environments.
- Provides recommendations for organizations considering passwordless authentication.
Sample Answer
Passwordless Authentication: A Paradigm Shift
- Technologies: FIDO2 (WebAuthn + CTAP) enables passwordless authentication using public-key cryptography. Biometrics (fingerprint, face, iris) provide inherence factors. Magic links and OTPs offer temporary, one-time access.
- Comparison: Passwordless authentication offers stronger security (phishing-resistant), better usability (no passwords to remember), but higher implementation cost and requires hardware support.
- Challenges: User adoption, hardware cost, account recovery, privacy concerns (biometrics), and integration with legacy systems.
- Enterprise potential: High; many organizations (e.g., Microsoft, Google) are already deploying passwordless authentication for employees.
- Recommendations: Start with a pilot for high-risk users, provide clear communication and training, and ensure a robust account recovery process.
Homework 3.3-3: Password Policy Implementation Plan
You are the security lead at a large e-commerce company with 10 million customer accounts and 3,000 employees. The company currently uses a password policy that requires 8-character passwords with complexity rules, 90-day expiry, and no MFA. Develop a comprehensive implementation plan to upgrade the password policy and deploy MFA. Your plan should include:
- A timeline with phases, milestones, and deliverables.
- Technical requirements (identity system, MFA provider, blacklist integration, etc.).
- User communication and training strategy.
- How to handle legacy accounts and password resets.
- Risk assessment and mitigation strategies.
- Success metrics and how they will be measured.
Sample Answer
Password Policy and MFA Implementation Plan
- Timeline (12 months): Phase 1 (Months 1–3): Deploy MFA for employees, upgrade employee password policy. Phase 2 (Months 4–6): Pilot MFA for customers, upgrade customer password policy. Phase 3 (Months 7–9): Full customer MFA rollout. Phase 4 (Months 10–12): Review and optimize.
- Technical requirements: Identity platform (Okta or Azure AD) with MFA support; integration with breach databases (Have I Been Pwned); self-service password reset and account recovery.
- Communication: Multi-channel communication (email, in-app messaging, blog posts). Training materials and FAQs for employees and customers.
- Legacy accounts: Gradual rollout; users can choose MFA enrollment after next login; eventually enforce MFA.
- Risk mitigation: Phased rollout to minimize disruption; extensive testing in staging; rollback plan.
- Success metrics: MFA adoption rate (target >95%), reduction in password reset tickets (target >50%), security incidents related to credentials (target >80% reduction).
Homework 3.3-4: Password Cracking Demo
Using a password cracking tool (e.g., John the Ripper, Hashcat) on a test system (or through a virtual lab), perform a password cracking exercise on a set of hashed passwords. Write a report that includes:
- The password hashing algorithm used.
- The password list used.
- The cracking method (dictionary, brute-force, hybrid).
- The results (how many passwords were cracked and in what time).
- Analysis of the cracked passwords (patterns, lengths, strengths).
- Recommendations for improving password security based on your findings.
Sample Answer
Note: This is a practical exercise. The sample answer below is a hypothetical report.
Report: Password Cracking Exercise
- Hashing algorithm: SHA-256 with salt (simulated).
- Password list: 100,000 commonly used passwords (from SecLists).
- Cracking method: Dictionary attack with rules (e.g., capitalization, leetspeak).
- Results: 45% of the passwords were cracked within 10 minutes. 65% within 1 hour using a GPU.
- Analysis: Most cracked passwords were short (<10 chars), used common words, or followed predictable patterns (e.g., Summer2024!). Many were found in the dictionary list.
- Recommendations: Enforce longer passwords, blacklist common passwords, use MFA, and encourage password managers.
Homework 3.3-5: Future of Passwords
Write a 1,000–1,250 word research paper on the future of password-based authentication. Address:
- The current state of password security and its challenges.
- Emerging technologies and standards (FIDO2, WebAuthn, biometrics, etc.).
- The role of password managers and MFA in the transition away from passwords.
- Predictions for the next 5–10 years: will passwords disappear? Why or why not?
- How organizations should prepare for the future of authentication.
- Recommendations for individuals and organizations.
Sample Answer
Future of Passwords: The Long Goodbye
- Current state: Passwords are the most common authentication factor but are a persistent security vulnerability. Password breaches continue to be a major threat.
- Emerging technologies: FIDO2/WebAuthn provides a strong, phishing-resistant passwordless solution. Biometrics are becoming more ubiquitous and trusted.
- Role of password managers: Password managers bridge the gap, providing strong unique passwords while we transition to passwordless.
- Predictions: Passwords will not disappear entirely in the next 5–10 years, but they will be complemented by and increasingly replaced by passwordless methods, especially in enterprise environments.
- Preparations: Organizations should adopt MFA, pilot passwordless authentication, and invest in identity management and user education.
- Recommendations: Encourage password managers, deploy MFA, and prepare for a passwordless future by evaluating authentication providers and standards.
Summary
Password-based authentication remains the most widely used authentication method, yet it is also one of the most vulnerable.
In this tutorial, we examined the role of passwords, their vulnerabilities, and the measures that can be taken to secure them.
We explored the human factors that contribute to password insecurity—such as password reuse, weak passwords, and
password fatigue—and the technical threats, including phishing, credential stuffing, dictionary attacks, and
brute-force cracking. We learned that secure password storage requires hashing with salt and key derivation functions
like bcrypt, PBKDF2, and Argon2, which are designed to be slow and, in the case of Argon2, memory-hard.
Password policies were discussed in the context of NIST SP 800-63B, with a focus on encouraging long passwords,
avoiding arbitrary complexity rules, and eliminating mandatory password expiry. Password managers were identified as
a key tool for addressing password fatigue and reuse, and passwordless authentication was explored as an emerging
alternative with significant potential.
Through two case studies—the LinkedIn 2012 breach and an enterprise password policy implementation—we saw the practical
implications of password security and the effectiveness of modern password policies.
This tutorial has equipped you with a comprehensive understanding of password-based authentication, its strengths, its
many vulnerabilities, and the defenses that organizations and individuals can employ. In the next tutorial, Tutorial 3.4,
we will extend this knowledge to multi-factor authentication (MFA) and other authentication technologies,
including one-time passwords, hardware tokens, and adaptive authentication.
© 2026 COMP400 – Computer and Network Security • School of Computing and Information Systems, TrustOpen University • Unit 3: Authentication and Access Control