Skills101
← All practice quizzes

Quiz: Password Storage Lab

5 questions · new set on every retakeNo time limitPass: 60%+10 XP on first pass

A hands-on lab that builds a complete password store with Python's standard library — PBKDF2 and scrypt with per-user salts, a self-describing storage format, upgrading legacy and weak hashes when users log in, an optional pepper, Unicode normalisation, safe reset tokens and tests that prove it all works.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    Why must the salt and iteration count be stored next to the hash?

  2. Question 2

    In the lesson's assumed numbers, roughly how much more does one PBKDF2 guess at 600,000 iterations cost than one SHA-256?

  3. Question 3

    When is the right moment to upgrade a user's legacy sha256 hash to PBKDF2?

  4. Question 4

    Why does the login function return "Incorrect username or password" in both failure cases?

  5. Question 5

    What does this print?

    import hashlib
    a = hashlib.pbkdf2_hmac("sha256", b"pw", b"salt-one", 1000).hex()
    b = hashlib.pbkdf2_hmac("sha256", b"pw", b"salt-two", 1000).hex()
    c = hashlib.pbkdf2_hmac("sha256", b"pw", b"salt-one", 1000).hex()
    print(a == b, a == c)
    
🎯 Today’s placement challenge — 10 questions, no login. Can you score 10/10?Take today’s challenge →