Find a course

Module 4: Multi-Factor Authentication and PasskeysLesson 7 of 1112 min

How Multi-Factor Authentication Works

Learn the three kinds of factors, how authenticator app codes are generated, and how to compare SMS, app codes, push prompts and hardware security keys.

Step 1 of 14Learn

A password isn't enough on its own

Imagine your email password leaks in a breach tomorrow. With only a password, the attacker signs in, reads everything and resets your other accounts. With multi-factor authentication (MFA), the attacker enters the correct password and then hits a wall: the site asks for a code from your phone or a tap on a security key they don't have.

MFA (also called two-factor authentication or 2FA, or two-step verification) requires proof from at least two different categories:

  • Something you know: a password, passphrase or PIN.
  • Something you have: a phone with an authenticator app, a hardware security key, a smart card.
  • Something you are: a fingerprint or face scan, usually used to open a device or authorize a key.

The categories matter. A password plus a security question is two things you know; one phishing page can collect both. A password plus a code from your phone forces the attacker to steal two different kinds of thing.

Large account providers have reported that turning on even basic MFA blocks the great majority of automated account takeover attempts. It isn't perfect, and later you'll see how attackers try to get around it, but it's the single biggest upgrade most people can make after unique passwords.

Step 2 of 14Practice · Sort into groups

Sort each item into the type of factor it represents.

Tap an item, then tap its group (or drag it there).

Step 3 of 14Practice · Diagram

The three factor categories

Tap the region where a passkey opened with your fingerprint belongs.

Tap the shape that answers the question, then press Check.

The three factor categoriesVenn diagram: What you know, What you have, What you are, What you know only, What you have only, What you are only, What you have + What you are (overlap).What you knowWhat you haveWhat you are• Password• PIN• Security key• Authenticator phone• Fingerprint• Face scan• Passkey + fingerprint
What you know
What you have
What you are
What you know only
  • Password
  • PIN
What you have only
  • Security key
  • Authenticator phone
What you are only
  • Fingerprint
  • Face scan
What you have + What you are (overlap)

The device is something you have; the biometric opens it on the device.

  • Passkey + fingerprint

Step 4 of 14Practice · Choose one

Which sign-in combination is true multi-factor authentication?

Step 5 of 14Learn

How authenticator codes work

Authenticator apps show a six-digit code that changes every 30 seconds. They work even with your phone in airplane mode. How?

When you turn on app-based MFA, the website shows a QR code containing a shared secret: a random key. Your app stores the secret, and so does the website. From then on, both sides run the same calculation, standardized as TOTP (time-based one-time password): they combine the secret with the current time, rounded to a 30-second window, and turn the result into a six-digit number. If your code matches the one the server calculates, you're in.

Because the code depends only on the secret and the clock, no network connection is needed. And because each code expires within about 30 seconds, a stolen code is useless shortly afterward.

Practical points:

  • Save the backup codes each site gives you when you turn on MFA. If you lose your phone, they're how you get back in.
  • Keep the phone's clock set automatically. A clock that's off by a few minutes produces wrong codes.
  • Plan for a new phone. Many authenticator apps can back up or transfer secrets; use that feature or move each account before wiping the old phone.

Step 6 of 14Practice · Work it out

An authenticator code is 6 digits long. How many possible codes are there?

Step 7 of 14Diagram

How an authenticator code is made

How an authenticator code is madeProcess diagram: Scan QR: shared secret → Current 30-second window → Same calculation on both sides → Six-digit code → Codes match: signed in.Scan QR: sharedsecretCurrent 30-secondwindowSame calculation onboth sidesSix-digit codeCodes match: signed in

Tap a shape with to see more.

Scan QR: shared secret

Stored by both your app and the website.

Current 30-second window

Why the phone clock must be set automatically.

Same calculation on both sides

Standardized as TOTP; no network needed.

Six-digit code

Expires within about 30 seconds.

Codes match: signed in

Step 8 of 14Learn

Comparing second factors

Not all second factors are equally strong. From weakest to strongest, roughly:

SMS and voice codes. A code is texted or read to your phone. It's much better than nothing, but vulnerable to SIM swapping (an attacker convinces your carrier to move your number to their SIM), to some interception methods and to phishing pages that ask you to type the code.

Email codes. Only as strong as your email account, and useless for protecting the email account itself.

Authenticator app codes (TOTP). Not tied to your phone number, so SIM swaps don't help attackers. Still phishable: a fake site can ask for the current code and use it immediately.

Push notifications. An app asks "Is this you signing in?" Convenient, but open to MFA fatigue attacks, where attackers send prompt after prompt hoping you tap Approve. Number matching, where you type a number shown on the sign-in screen into the app, reduces this risk.

Hardware security keys and passkeys. Based on public-key cryptography and bound to the real website's domain, so a fake site can't use them. These are called phishing-resistant.

The best factor is the strongest one you'll actually use. Any MFA beats none.

Step 9 of 14Practice · Put in order

Rank these second factors from least to most resistant to phishing.

Drag the items, or use the arrow buttons, to put them in order.

  1. Hardware security key or passkey
  2. SMS text message code
  3. Authenticator app code
  4. Push prompt with number matching

Step 10 of 14Practice · Diagram

Second factors, from weakest to strongest

Which level is phishing-resistant?

Tap the shape that answers the question, then press Check.

Second factors, from weakest to strongestPyramid diagram: SMS and voice codes, Email codes, Authenticator app codes, Push with number matching, Security keys and passkeys.SMS and voice codesEmail codesAuthenticator app codesPush with numbermatchingSecurity keys and passkeys
SMS and voice codes

Exposed to SIM swapping and phishing. Still far better than nothing.

Email codes

Only as strong as the inbox.

Authenticator app codes

Immune to SIM swaps, but a fake site can relay them.

Push with number matching

Reduces MFA fatigue approvals.

Security keys and passkeys

Bound to the real domain: phishing-resistant.

Step 11 of 14Note

Step 12 of 14Learn

Backup codes and lost phones

The most common MFA problem isn't an attack. It's a broken, lost or replaced phone. If your authenticator app lived only on that phone and you didn't save backup codes, getting back into your accounts can take days of identity checks, and some services may not be able to restore access at all.

When you turn on MFA, most services show a set of backup codes (also called recovery codes), each usable once. Treat them like a spare house key:

  • Print them or write them down and keep them with important papers, or store them in your password manager (but not only there if the manager itself is protected by the same phone).
  • Register a second method where possible: a second phone, a security key or a passkey in your password manager.
  • Before trading in or wiping a phone, transfer authenticator accounts using the app's export or backup feature, or move each account manually, and test that codes work on the new device.

A few minutes of preparation turns a lost phone from a crisis into a minor errand.

Step 13 of 14Practice · Choose one

What is the best way to prepare for losing the phone that holds your authenticator app?

Step 14 of 14Practice · True or false

SMS codes are so weak that you should leave MFA turned off if SMS is the only option a site offers.