Account and Network Safety

Two-Factor Authentication Explained

How a second sign-in step protects an account even when a password is stolen, and how text codes, authenticator apps and security keys compare.

On this page
  1. The idea in one paragraph
  2. The three kinds of “factor”
  3. How a typical sign-in works
  4. Types of second step
  5. A rough comparison
  6. What 2FA does not do
  7. Setting it up well
  8. If you lose access
  9. Is it worth the extra effort?

The idea in one paragraph

A password is one proof that you are you. Two-factor authentication, often shortened to 2FA, asks for a second proof of a different kind. If someone learns your password through a leak, a lucky guess or a fake login page, they still cannot get in without the second item. That is why it is one of the most commonly recommended steps for protecting an account.

The three kinds of “factor”

Security people group proofs into categories:

  • Something you know, such as a password or PIN.
  • Something you have, such as your phone or a physical key.
  • Something you are, such as a fingerprint or face.

Two-factor authentication combines two different categories. Entering a password and then a second password is not two factors, since both are things you know.

How a typical sign-in works

You enter your username and password as usual. The service then asks for a second step: a code, an approval on your phone, or a tap of a security key. Only when both succeed are you let in. Many services remember a device you trust, so you are not asked every time on your own laptop.

Types of second step

Text message codes

The service sends a short code by SMS, which you type in. This is simple, needs no extra app, and works on almost any phone. It is also generally the weakest common option. Attackers can sometimes trick a mobile carrier into moving your number to a SIM they control, or persuade you to read out a code, as in smishing attacks. Text codes are still much better than no second step.

Authenticator apps

An authenticator app generates a code that changes every 30 seconds or so, using a secret shared with the service when you set it up. The code does not travel over the phone network, so it avoids the SIM-swap problem. It still can be typed into a fake page, so it does not fully stop phishing. If you lose the phone, you need your recovery options, so make sure the app supports backup or that you save the setup recovery codes.

Push approvals

Some services send a notification asking you to approve or deny a sign-in. They are quick to use. The risk is “prompt fatigue”: an attacker with your password triggers repeated requests hoping you tap approve. If you get a prompt you did not start, deny it and change your password. Some services reduce this risk by asking you to enter a number shown on the sign-in screen.

Hardware security keys

A security key is a small physical device that you plug in or tap against your phone. It proves you have the key, and it is tied to the real website, so it is generally considered the strongest option against phishing. The downsides are cost, the possibility of losing it, and the need to register a spare.

Biometrics and passkeys

Fingerprint and face unlock normally unlock a device or an app rather than act as a standalone second factor for a website, though they often play a part. Passkey sign-in combines “something you have” (your device) with “something you are or know” (its unlock method) in a single step, and is designed to resist phishing.

Email codes and backup codes

Some services send codes to email. This is only as safe as the email account itself, so protect that with a strong second step. Backup codes are one-time codes issued when you set up 2FA, meant for emergencies.

A rough comparison

Method Convenience Resists phishing Main weakness
Text message High Low SIM swaps and tricks to share codes
Authenticator app Medium Low to medium Lost phone without backup
Push approval High Low to medium Approving by mistake
Security key Medium High Cost and loss
Passkey High High Needs site support and device care

These are general comparisons, and the details depend on how each service implements them.

What 2FA does not do

Two-factor authentication raises the bar but does not make an account untouchable. A convincing fake page can capture both your password and a code in real time and use them immediately. Malware on your device may bypass it, and a scammer on the phone may talk you into sharing a code. Never tell anyone a verification code, including someone claiming to be from the company, because services do not need to ask you for it.

Setting it up well

  1. Start with the accounts that matter most: email first, since it can reset other accounts, then banking, shopping and social media.
  2. Choose the strongest method offered. An authenticator app or key is generally better than text, but text beats nothing.
  3. Save the recovery codes somewhere safe and separate from your phone, such as a password manager or a printed copy in a secure place.
  4. Register more than one method where you can, such as a second device or a spare key.
  5. Update your phone number or email with the service so recovery works.
  6. Keep a password manager for the first factor, so each account has its own strong password. A unique password plus a second step is a solid base.

If you lose access

Losing your phone is the usual way people lock themselves out. Use your backup codes, a second registered device, or the service’s recovery process, which may take time and ask for proof of identity. This is the reason to prepare in advance rather than after the problem.

Is it worth the extra effort?

For most people, yes. The extra few seconds per sign-in is small compared with the effort of recovering a compromised account. No method is perfect, and which one fits depends on your devices and the service. Choosing any second step on your important accounts is a meaningful improvement.

The complete guide to account and network safety

How to Stay Safe Online: A Guide to Cybersecurity
Read the guide

Keep exploring

Guides from other topics

All topics →