edubun
English
1 / 21

2 / 6 · Intermediate

Two-step sign-in

A six-digit code has exactly 1,000,000 possible values, so a thief with your password who gets five guesses has a 1 in 200,000 chance.

Jump to the 10 practice questions

You will learn

  • Tell the three kinds of factor apart
  • Rank SMS codes, app codes and security keys
  • Keep recovery codes and a second factor ready

Before this: Passwords and passkeys

1Explain

A thief has your password. What are the odds of the code?

Start with a puzzle. Someone has stolen your password, but the site also asks for a six-digit code, and the thief gets five tries. How likely is a lucky guess? Work it out in the exercise below before reading on.

2Practice

Count the codes

Fix the exponent so the program prints how many six-digit codes exist, then the chance of guessing one in five tries.

Expected output
1000000
0.000005
Your code
const codes = 10 ** 1;  // change: how many six-digit codes are there (000000 to 999999)?
console.log(codes);
console.log(5 / codes);  // chance of guessing right in 5 tries
Hint

Six digits, ten choices each.

A solution
const codes = 10 ** 6;
console.log(codes);
console.log(5 / codes);

3Explore

One in 200,000

Six digits run from 000000 to 999999, which is 10⁶ = 1,000,000 codes. Five guesses give a chance of 5 in 1,000,000, or 1 in 200,000. With the password alone the thief was already in. With the code, almost never. That gap is what multi-factor authentication buys you.

The second line is the "1 in" number: one lucky guess in that many attempts.

Digits
Tries
const digits = 6;
const tries = 5;
const codes = 10 ** digits;
console.log(codes);
console.log(codes / tries);
Output
1000000
200000

4Problem

Six-digit codes

How many different six-digit codes are there?

Hint

000000 to 999999.

Solution

Answer: 1000000

All six positions allow ten digits, including a leading zero: 10⁶ = 1,000,000, from 000000 to 999999. Do not leave out codes that start with zero.

5Explain

Three kinds of proof, and why two passwords are still one

Multi-factor authentication, often called two-factor or two-step sign-in, asks for proof from more than one kind of factor. CISA sorts the kinds into something you know (a password or PIN), something you have (a phone or a security key) and something you are (a fingerprint or face). Two passwords are still one kind. CISA's advice for everyone is to turn MFA on for every account that offers it, starting with email, social media and financial accounts.

The three kinds of factor. Two-step sign-in combines two different kinds; two passwords are still one kind.

6Problem

Real two-factor

Which pair is real two-factor authentication?

Hint

Two different kinds of proof.

Solution

Answer: A password and a code from an app on your phone

Know plus have. A security question is another thing you know.

7Problem

MFA first

Which account should get MFA first?

Hint

It can reset all the others.

Solution

Answer: Email

Reset links for other accounts go to your email.

8Explain

Codes that can be relayed, and keys that cannot

The common options differ in how well they hold up. A code sent by text message or voice call travels over the phone network. NIST classes this as a restricted authenticator. It is still allowed, but services must offer an alternative and warn users of the risks. They should watch for signs such as a recent SIM change or number transfer. Criminals can talk a phone company into moving your number to their SIM. A code from an authenticator app is generated on your phone and never crosses the network.

9Problem

SMS codes

How does NIST class codes sent by SMS or voice call?

Hint

Allowed, with a warning and an alternative.

Solution

Answer: Restricted

Allowed, but services must offer an alternative and explain the risks.

10Explain

Codes can be relayed

All of these can still be phished. A fake login page asks for your code, you type it in, and the criminal passes it to the real site within seconds. NIST says plainly that methods involving manual entry of a code are not phishing-resistant, because nothing ties the code to the real site. CISA calls phishing-resistant MFA the gold standard and says the only widely available kind is FIDO/WebAuthn: security keys and passkeys, which, as the previous unit showed, only answer to the site they were made for.

11Problem

Typed codes

Why are typed one-time codes not phishing-resistant?

Hint

Nothing ties the code to the real site.

Solution

Answer: A fake site can pass the code to the real one

Nothing binds the code to the real site (NIST 3.2.5).

12Problem

The gold standard

According to CISA, the only widely available phishing-resistant MFA is

Hint

Security keys and passkeys.

Solution

Answer: FIDO/WebAuthn

Security keys and passkeys use FIDO/WebAuthn.

13Problem

Twenty prompts

Your phone shows twenty approval prompts you did not request. What should you do?

Hint

Someone already has your password.

Solution

Answer: Deny them and change that account's password

Someone has your password and is trying push bombing.

14Problem

Against push bombing

What does CISA recommend against push bombing?

Hint

The phone asks for the number shown on the screen.

Solution

Answer: Number matching

Typing the number shown on screen stops blind approvals.

15Explain

Before the phone goes missing

When you turn on two-step sign-in, most services show a list of one-time recovery codes. NIST calls these look-up secrets. They are your way back in if you lose your phone, so keep them somewhere safe and separate from the phone: printed and stored at home, or in a password manager. Never paste them into an email to yourself, and never read one out to someone who calls you. No genuine support team needs it.

16Problem

Recovery codes

Where should recovery codes be kept?

Hint

Not on the phone and not in your email.

Solution

Answer: Somewhere safe, separate from your phone

Keep recovery codes safe and separate from the phone, because they replace the missing factor if it is lost. A copy available only on that phone would be lost with it.

17Explain

Plan for a lost phone

Plan for a lost or replaced phone before it happens. Most services let you register more than one second factor, for example an authenticator app and a security key, or a passkey on two devices. When you change phones, move your authenticator app or passkeys to the new phone before you wipe the old one. If a phone is lost, sign in with a recovery code or another factor and remove the lost device from each account.

18Practice

An easy code field

Make this code field easy to fill: tie the label to it with for, and add autocomplete="one-time-code" and inputmode="numeric" so phones offer the code and a number pad.

Checks
  • label tied to the field
  • autocomplete one-time-code
  • inputmode numeric
Your code
<form>
  <label>Six-digit code</label>
  <input id="otp" type="text">
  <button>Verify</button>
</form>
Preview
Hint

for="otp" on the label, two attributes on the input.

A solution
<form>
  <label for="otp">Six-digit code</label>
  <input id="otp" type="text" autocomplete="one-time-code" inputmode="numeric">
  <button>Verify</button>
</form>

19Problem

The autocomplete value

Which autocomplete value marks a one-time code field?

Hint

The value used in the lab.

Solution

Answer: one-time-code

autocomplete="one-time-code" (MDN).

20Explain

Common mistakes

  • "A password plus a security question is two-factor."

    Both are things you know, so it is still one kind of factor. Two-factor needs a different kind, such as a code from an app on your phone or a security key.

  • "Codes by text message stop phishing."

    A fake page can ask for the code and pass it on within seconds. NIST says codes entered by hand are not phishing-resistant, and it classes SMS codes as restricted because a phone number can be moved to a criminal's SIM.

  • "If approval prompts keep coming, approving one makes them stop."

    It does stop them. The attacker is in. A flood of prompts you did not ask for means someone has your password: deny them and change that password.

  • "Recovery codes are safe in an email to myself."

    Whoever gets into that inbox then has the codes as well. Keep them apart from the phone and the email, on paper at home or in a password manager.

21

Summary

  • MFA combines different kinds of factor: know, have, are.
  • Turn it on everywhere, starting with email.
  • Typed codes can be relayed by a fake site; FIDO/WebAuthn cannot.
  • Keep recovery codes safe and never share them.

Next unitSpotting phishing
Full text · The whole lesson as one text

A thief has your password. What are the odds of the code?

Start with a puzzle. Someone has stolen your password, but the site also asks for a six-digit code, and the thief gets five tries. How likely is a lucky guess? Work it out in the exercise below before reading on.

Six digits run from 000000 to 999999, which is 10⁶ = 1,000,000 codes. Five guesses give a chance of 5 in 1,000,000, or 1 in 200,000. With the password alone the thief was already in. With the code, almost never. That gap is what multi-factor authentication buys you.

Three kinds of proof, and why two passwords are still one

Multi-factor authentication, often called two-factor or two-step sign-in, asks for proof from more than one kind of factor. CISA sorts the kinds into something you know (a password or PIN), something you have (a phone or a security key) and something you are (a fingerprint or face). Two passwords are still one kind. CISA's advice for everyone is to turn MFA on for every account that offers it, starting with email, social media and financial accounts. Email comes first because password reset links are sent there. Whoever controls your inbox can reset almost everything else.

The three kinds of factor. Two-step sign-in combines two different kinds; two passwords are still one kind.

Codes that can be relayed, and keys that cannot

The common options differ in how well they hold up. A code sent by text message or voice call travels over the phone network. NIST classes this as a restricted authenticator. It is still allowed, but services must offer an alternative and warn users of the risks. They should watch for signs such as a recent SIM change or number transfer. Criminals can talk a phone company into moving your number to their SIM. A code from an authenticator app is generated on your phone and never crosses the network. Push notifications ask you to tap Approve. Criminals sometimes send dozens of prompts, hoping you tap one to make them stop, so CISA recommends number matching, where you type a number shown on the login screen.

All of these can still be phished. A fake login page asks for your code, you type it in, and the criminal passes it to the real site within seconds. NIST says plainly that methods involving manual entry of a code are not phishing-resistant, because nothing ties the code to the real site. CISA calls phishing-resistant MFA the gold standard and says the only widely available kind is FIDO/WebAuthn: security keys and passkeys, which, as the previous unit showed, only answer to the site they were made for. Any MFA is still much better than none.

Before the phone goes missing

When you turn on two-step sign-in, most services show a list of one-time recovery codes. NIST calls these look-up secrets. They are your way back in if you lose your phone, so keep them somewhere safe and separate from the phone: printed and stored at home, or in a password manager. Never paste them into an email to yourself, and never read one out to someone who calls you. No genuine support team needs it.

Plan for a lost or replaced phone before it happens. Most services let you register more than one second factor, for example an authenticator app and a security key, or a passkey on two devices. When you change phones, move your authenticator app or passkeys to the new phone before you wipe the old one. If a phone is lost, sign in with a recovery code or another factor and remove the lost device from each account.

Common mistakes
  • "A password plus a security question is two-factor." Both are things you know, so it is still one kind of factor. Two-factor needs a different kind, such as a code from an app on your phone or a security key.
  • "Codes by text message stop phishing." A fake page can ask for the code and pass it on within seconds. NIST says codes entered by hand are not phishing-resistant, and it classes SMS codes as restricted because a phone number can be moved to a criminal's SIM.
  • "If approval prompts keep coming, approving one makes them stop." It does stop them. The attacker is in. A flood of prompts you did not ask for means someone has your password: deny them and change that password.
  • "Recovery codes are safe in an email to myself." Whoever gets into that inbox then has the codes as well. Keep them apart from the phone and the email, on paper at home or in a password manager.
Teacher's noteThe idea of "kinds" of factor is where confusion starts. Before talking about SMS or passkeys, give learners a mixed list (password, PIN, security question, app code, fingerprint, security key) and have them sort it into the three boxes of the figure. Then do the six-digit arithmetic so the benefit has a number. Compare the methods last, and finish on "any MFA beats none", so nobody leaves thinking text-message codes are worthless.
Key points
  • MFA combines different kinds of factor: know, have, are.
  • Turn it on everywhere, starting with email.
  • Typed codes can be relayed by a fake site; FIDO/WebAuthn cannot.
  • Keep recovery codes safe and never share them.

Practice questions from Two-step sign-in on edubun

Embed this quiz

Free to embed. Please keep the credit line.

Sources for this course (13)
  • (checked 2026-10-17)
  • Standard: NIST SP 800-63B-4, Digital Identity Guidelines: Authentication and Authenticator Management (pages.nist.gov/800-63-4/sp800-63b.html, final 31 July 2025 per the csrc.nist.gov document history (Date Published: July 2025), checked 2026-10-17: sec. 3.1.1.2 password rules, 3.1.3.3 PSTN restricted, 3.2.5 phishing resistance, Appendix B syncable authenticators)
  • Law: 개인정보 보호법 제2조 (국가법령정보센터, law.go.kr)
  • Official agency guidance: CISA Secure Our World: Use Strong Passwords, Turn on MFA, Recognize and Report Phishing, Update Software, and tip sheets (cisa.gov/secure-our-world, checked 2026-10-17)
  • CISA, More than a Password (cisa.gov/MFA) and fact sheet Implementing Phishing-Resistant MFA (2022)
  • checked 2026-10-17
  • CISA #StopRansomware Guide (checked 2026-10-17)
  • CISA, Back Up Business Data and Data Backup Options (Ruggiero and Heckathorn, 2012, Carnegie Mellon University, produced for US-CERT, which CISA retired into CISA.gov on 24 February 2023; 3-2-1 rule) (checked 2026-10-17)
  • KISA, 118 상담 서비스 (kisa.or.kr/118, checked 2026-10-17)
  • KISA 보호나라 스미싱 확인서비스 (boho.or.kr, checked 2026-10-17)
  • KISA 개인정보침해 신고센터 (privacy.kisa.or.kr, checked 2026-10-17)
  • Technical documentation: MDN Web Docs, Passkeys (developer.mozilla.org/en-US/docs/Web/Security/Authentication/Passkeys, checked 2026-10-17) and autocomplete attribute (checked 2026-10-17)
  • History block only (the backups story): Data Backup Options (2012) and the Peter Krogh book it credits. No product is recommended.

Checked: 2026-10-17