Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 01 · Security · Think Like an Attacker · about 18 min to read

Watch: Auth, end to end: passwords, tokens, OAuth, OIDC, SSO and SAML
▶ VideoPlay it as a journeyTutor comes with a plan

Authentication

Authentication
Authentication · Open board

One real login, drawn end to end: how a password is stored so a stolen database is useless on its own, and how a browser stays logged in afterward without resending it. It puts the hash and the HMAC from Cryptography Foundations to work.

Before you start. Cryptography Foundations gave you two tools this lesson spends. A hash scrambles anything into a fixed-length string with no way back to the original. An HMAC is a hash mixed with a secret key, so only whoever holds that key could have produced it. Nothing else is assumed.

Think of one building with one door. Everyone who works there set a PIN on their first day, to prove at the door they are who they say. What the building does with that PIN, and what it hands you afterward so you don’t retype it at every elevator, is this lesson.

Lesson 3 of 39 in Security · Free with an account

Keep reading. It's free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

No card, and chalk sends no email. Google sign-in only.

Start free with Google

In this lesson

  • December 2009: 32 million passwords, sitting in plain text
  • 1978: the fix that was already thirty years old
  • Staying inside: a logbook kept, or a badge that checks itself
  • The badge, edited
  • Slow, measured
  • Credential stuffing, as arithmetic
  • Sessions and tokens, side by side
  • The JWT, decoded, and where to store it
  • The forgery from the story, in real code
  • MFA / TOTP, and the whole flow

Terms it explains: hash, salt, session, cookie, token, cost, 128,000 times, once per login, once per guess, Credential stuffing, JWT, Header, Payload, claims, Signature, `alg:none`, `exp`, httpOnly, Secure, SameSite, localStorage, constant time, MFA, TOTP, phishing-resistant, not encrypted, authentication (authN), authorization (authZ), bcrypt/scrypt/argon2, factors, httpOnly / Secure / SameSite, pepper, rainbow table, refresh token, token/JWT, WebAuthn / passkeys, work factor.

Lab

You sign a stolen login out everywhere. How long does the thief's copy keep working?

Drag How long a badge lives from an hour to 15 minutes and watch the refreshes and the thief's window move.

Open The revocation window

A million password hashes have been stolen. How much does a slower hash actually buy you?

Drag The password from 8 letters or digits to the most common ones and watch every row collapse.

Open The slow hash

Related paper

Review Security