Course contentsShow
← Computer Science
Lesson 2509 of 2,87256. Authentication and AuthorizationFree lesson

PBKDF2 and Key Derivation

Password-Based Key Derivation Function 2: iteration counts and appropriate use cases.

PBKDF2 and Key Derivation

You'll learn how PBKDF2 applies iterative hashing to strengthen password-based keys and when to use it over other algorithms.

What is PBKDF2?

Password-Based Key Derivation Function 2 (PBKDF2) is a key derivation algorithm that transforms a password into a cryptographic key by repeatedly applying a cryptographic hash function. It's been a standard since 2000 and is still widely used for password storage and generating encryption keys.

How Iteration Counts Work

PBKDF2's security comes from iteration counts — the number of times it applies the hash function. Each iteration takes the output of the previous hash and feeds it back in, creating a computationally expensive process.

Think of it like wrapping a gift box: one layer of wrapping paper is easy to tear through, but 10,000 layers? That takes serious time and effort. An attacker trying to crack passwords must repeat all those iterations for every guess, dramatically slowing their attack.

Common iteration counts range from 10,000 to 600,000+ rounds, depending on your security requirements and performance constraints.

Appropriate Use Cases

Best for:

  • Legacy systems requiring FIPS-140-2 compliance
  • Situations where bcrypt or Argon2 aren't available
  • Deriving encryption keys from passwords (its original purpose)

Consider alternatives when:

  • You have the freedom to choose modern algorithms (Argon2 is generally superior)
  • You need memory-hardness to defend against GPU/ASIC attacks (PBKDF2 is CPU-bound only)
  • Maximum security is required (bcrypt or Argon2 resist specialized hardware better)

PBKDF2 is still secure when configured with high iteration counts, but it's weaker against parallel attacks than memory-hard alternatives.

Key Takeaway: PBKDF2 uses iteration counts to slow down password cracking attempts, making it suitable for compliance scenarios and key derivation, but modern alternatives like Argon2 offer better protection against GPU-based attacks.