Hashing and passwords

One-way functions and the logins built on them: SHA-256 and the avalanche effect, why MD5 and SHA-1 fell, salted slow password hashes, honest password strength and two-factor codes.

About 10 hours of study

Learning objectives

Lessons

  1. 1

    Hash functions and the avalanche effect

    What a cryptographic hash such as SHA-256 promises (fixed size, one-way, collision resistant), the avalanche effect seen bit by bit, and why a hash is not encryption.

  2. 2

    Why MD5 and SHA-1 are broken

    The birthday paradox and the birthday bound, what it means for a hash to be broken, and the real collision attacks on MD5 and SHA-1 that pushed the world to SHA-256.

  3. 3

    Storing passwords: salt and slow hashes

    Why sites store a salted, slow hash instead of your password: what precomputed tables are, how a per-user salt defeats them, and how bcrypt, scrypt and Argon2 slow attackers down on purpose.

  4. 4

    Password strength and entropy

    Measuring password strength honestly: entropy as length × log₂(pool), why length beats symbols, why passphrases work, and why patterns people use make the real strength far lower.

  5. 5

    Two-factor authentication and one-time codes

    The three kinds of factor, how authenticator apps compute a fresh six-digit TOTP code every 30 seconds from a shared secret and the clock, and why passkeys resist phishing when SMS codes do not.

Module practice

Module quiz

1. Which statement about hashing is true?
2. Roughly how many hashes must an attacker compute to expect a collision in a 64-bit hash?
3. Two users have the same password and the database stores hash(salt + password) with different salts. What does an attacker who steals it see?
4. A random 10-character password uses lower- and upper-case letters and digits. About how many bits of entropy does it have?
5. Why is an SMS one-time code weaker than a code from an authenticator app?
6. A site stores passwords with plain SHA-256, no salt. Which change helps most against a stolen database?

‹ CryptographyNetwork security ›