04.6.1 · Skill in Security and privacy engineering

Authentication

Verifying who a user is.

Authentication covers passwords, sessions, tokens, single sign-on and passkeys. It is easy to get subtly wrong, so proven libraries and services are usually the right choice. Its design also affects signup friction.

Your status · Authentication

Saved in this browser. Sign in to keep it on every device.It colours this skill's tile on your map.

Why it matters for a product engineer

Authentication is the door to every account. It is easy to get subtly wrong, and one mistake exposes everything behind it. It is also the first friction in the product: every rule on a signup form loses some people. A product engineer decides both sides, the security and the experience.

How to do it

  1. Use a proven service or library. Prefer sign-in without a password: passkeys, or a provider people already use.
  2. If you keep passwords, follow NIST: ask for length, not a mix of characters. Accept long passwords, spaces and Unicode, and allow paste, so password managers work.
  3. Compare each new password with a list of breached and common passwords, and say why you reject one.
  4. Store passwords with a slow, salted password hash, such as Argon2id or bcrypt.
  5. Limit failed attempts, and offer a second factor.
  6. Use the same generic message for a wrong user name and a wrong password, at sign-in and at password reset.

Common mistakes

  • Rules for symbols and digits. NIST notes that people respond to them in very predictable ways.
  • Forced password changes every few months.
  • Security questions, such as the name of a first pet.
  • Writing your own session or token logic.
  • A signup form that asks for a password before the person has seen any value.

Example

NIST asks for a check against breached passwords, but sending a password to an outside service is a new risk. Cloudflare and Troy Hunt’s Pwned Passwords solved this with k-anonymity. The site hashes the password with SHA-1 and sends only the first 5 of the 40 hexadecimal characters. The service returns every breached hash that starts with them, about 478 on average, and the site compares them itself. The password, and even its full hash, never leave the site.

Side by side

Password rules, old habits and NIST in 2025

Old habitNIST SP 800-63B-4
Minimum length8 characters15, or 8 with a second factor
A mix of character typesRequiredNot allowed
Change on a scheduleEvery few monthsOnly after a compromise
Security questionsCommonNot allowed
Check against breached passwordsNoYes

The new rules move the work from the person to the system: long passwords, nothing to remember about symbols, and a check against breached ones.

ReportedNIST SP 800-63B-4, Aug 2025

Sources: NIST SP 800-63B-4: authentication and authenticator management ↗ · Validating leaked passwords with k-anonymity (Cloudflare) ↗ · Authentication cheat sheet (OWASP) ↗

In practice

Real products

Resources

1

Tools

1
Tools for Security and privacy engineering
  • ToolFreemium
    Semgrep

    Static analysis for security bugs and code patterns, with an open-source core engine.