Skip to content
Cyber Security Firms

Two-Factor Authentication: How 2FA Works and Which to Use

A password is one secret, and secrets travel. Two-factor authentication adds a second proof that whoever stole the first one does not have, and which kind of second factor you pick matters more than anyone tells you.

Beginner14 min readUpdated
Two-Factor Authentication: How 2FA Works and Which to Use

Your password is one secret, and secrets travel. It gets typed into a look-alike login page, pulled out of a company's database, or reused on a site that leaks two years later. The 2026 Verizon Data Breach Investigations Report recorded the first year in nineteen in which stolen credentials were not the leading way into a breach, and only because the exploitation of unpatched software passed them, at 31 percent of cases. Two-factor authentication is the control that makes a stolen password worth nothing by itself. It is also the control most people switch on once, in the weakest form on the menu, and never look at again.

What Is Two-Factor Authentication?

Two-factor authentication, usually shortened to 2FA, is a login that requires two different kinds of proof before it lets you in. The password is the first. The second is something the attacker would have to physically hold or physically be.

Security people sort proofs into three categories, and the whole idea rests on the second factor coming from a different category than the first.

FactorWhat it meansExamples
Something you knowA secret held in your headPassword, PIN, the answer to a security question
Something you haveAn object in your possessionYour phone, an authenticator app, a hardware security key, a bank card
Something you areA physical characteristicFingerprint, face scan

A password plus a security question is not two-factor authentication, because both are things you know and both can be discovered the same way. A password plus a code generated on the phone in your pocket is, because stealing the first no longer gets anyone the second. This is the same principle as the basic account hygiene that sits under every other defense: make the attacker solve two unrelated problems instead of one.

Fingerprints confuse people here. On a phone, the fingerprint is usually not sent anywhere: it unlocks a key already stored on the device, so what the service receives is proof you hold the phone. The fingerprint is the door to the second factor, not the factor itself.

How Two-Factor Authentication Works

The mechanics are the same everywhere, whatever the branding on the screen. You prove the password. The service then asks for proof of the second factor and refuses to open a session until it gets one.

A normal login with an authenticator app
YouThe serviceYour phoneEmail and passwordCorrect, now the second factorOpen the authenticator appA six digit code, good for 30 secondsType the codeBoth factors match, session opens
An attacker holding only the stolen password stops at row two. The code is generated on a device they are not holding.

The code in row four is not sent to your phone. When you set up an authenticator app by scanning a QR code, the service and the app agree on one shared starting secret, and from then on both sides compute the same six digits from that secret and the current time. That is why the app works on a plane with no signal, and why the code changes every thirty seconds.

Push prompts work differently: the service really does send a notification, and you approve it. Text message codes are sent too, over the phone network. The difference matters, and it is the whole subject of the next two sections.

What none of it changes is the first factor. Two-factor authentication does not repair a weak or reused password; it buys you time and a second lock. And it does not stop credential phishing from asking you for both.

Types of Two-Factor Authentication

CISA publishes a ranking of MFA forms from strongest to weakest, based on which attacks each one survives. It is the most useful single table in this subject, and the version below adds passkeys, which sit in the same top tier because they use the same FIDO/WebAuthn cryptography.

FormHow it worksWhat defeats it
Passkeys and hardware security keysA private key on your device or key signs a challenge from the site, and will only sign for the real domainNothing remote. Physical theft of the device plus its unlock
Authenticator app codesThe app and the service compute the same six digits from a shared secret and the clockA phishing page that asks for the code and relays it in seconds
Push prompt with number matchingYou type digits shown on the login screen into the app to approvePhishing, if the attacker keeps you on the line. Not push bombing
Push prompt without number matchingYou tap approve on a notificationPush bombing, and plain fatigue at 2am
Codes by text message or voice callThe service sends a code over the phone networkPhishing, SIM swap, and interception of the phone network itself

The threats in the right column are not hypothetical. CISA's fact sheet on phishing-resistant MFA defines push bombing as attackers who "bombard a user with push notifications until they press the 'Accept' button", describes SIM swap as convincing a cellular carrier to move your number to a card the attacker holds, and notes that flaws in the SS7 telephone signaling protocol can be used to obtain codes sent by text or voice. Its verdict on the bottom row is blunt: SMS or voice "should only be used as a last resort MFA option".

A small hardware security key resting on a plain flat surface next to a laptop edge

Passkeys and security keys. A passkey is a private key stored on your phone, laptop or password manager, and a security key is the same idea in a small object you plug in or tap. Both refuse to sign for a domain that is not the real one, which is why CISA states that "the only widely available phishing-resistant authentication is FIDO/WebAuthn authentication". A passkey can also replace the password entirely rather than sit behind it.

Authenticator apps and push prompts. The app is the right default for almost everyone: offline, free, and immune to anything that happens to your phone number. It is still phishable, because a code you can read out is a code you can be tricked into reading out. Push prompts are more convenient, and CISA recommends number matching on them as the interim step for organizations that cannot reach passkeys yet.

Text message codes. Weakest, and still worth having where nothing else is offered, because the alternative is no second factor at all. Google says on its own help page that codes sent by text or call "can be vulnerable to phone number-based hacks". Where it matters most is the account that resets all the others: never leave email or your bank on SMS alone if the service offers anything better. The rest of the defenses and tools assume that account was the one you protected first.

What Is the Difference Between 2FA and MFA?

Counting, and nothing else. Two-factor authentication means exactly two factors. Multi-factor authentication, or MFA, means two or more. Every 2FA setup is MFA; not every MFA setup stops at two.

Consumer services say 2FA, or in Google's case 2-Step Verification. Business and government documents say MFA, because a workplace login may layer a password, a device certificate and a biometric check, and because compliance frameworks are written in those terms. NIST's SP 800-63B revision 4, the federal standard for digital identity, does not grade you on the count. It grades on assurance level, and states that applications assessed at authentication assurance level 2 "must offer a phishing-resistant authentication option". That is the useful way to read the difference: what matters is not how many factors you have but whether one of them can be relayed by a fake page.

How to Set Up Two-Factor Authentication

Order matters more than speed. Email first, always, because every other account's reset link lands there.

Apple accounts are a special case worth knowing: two-factor authentication is on by default there and is required for Apple Pay and Sign in with Apple, so the question is usually whether your trusted phone number is still current rather than whether the feature is on.

How Do I Get a Two-Factor Authentication Code?

From one of four places. An authenticator app generates it on the device with no signal needed. A text message or automated call delivers it over the phone network. A push notification replaces the code with an approve button. A saved backup code works once, when nothing else does.

Codes expire fast, in about thirty seconds for an app and a few minutes for a text, and typing one that has just rolled over is the most common reason a login fails. If nothing arrives at all: check that the phone number on the account is still yours, look in the blocked list on the phone, and use "resend" once rather than five times.

Is 2FA No Longer Secure?

It is secure against the attack it was built for and weaker than most people think against the attack that replaced it. Codes stop the attacker who bought your password in a dump, and that is still the majority of attempts. What codes do not stop is a proxy page that sits between you and the real service and passes everything through in real time.

How a relay attack defeats a one-time code
YouFake pageThe real serviceOpen the link, type email and passwordRelayed within a secondSend the one-time codeThe page asks for your codeType the six digitsCode relayed, session cookie issuedSigned in as you
Every row here works because the code is a string you can be persuaded to hand over. A passkey breaks the chain at row one: it is bound to the real domain and will not sign for a look-alike.

That is why the standards bodies now talk about phishing resistance rather than factor counts. A passkey or security key never produces anything you can type, and it checks the domain before it signs, so the fake page has nothing to relay. NIST's revision 4 goes further on the bottom of the table: authentication over the public telephone network carries extra requirements precisely because numbers get ported and SIMs get swapped, and it bans email outright as a channel for out-of-band codes.

The human version of the relay is simpler and shows up throughout this year's breach reports: someone calls an employee, claims to be IT, and asks them to read back the code or approve the prompt that just appeared.

Myth vs reality
What people believe
I have two-factor authentication turned on, so my account cannot be taken over.
What actually happens
Codes and push prompts can be phished in real time or talked out of you on the phone, and CISA's own guidance ranks them below FIDO/WebAuthn for exactly that reason. They still block the large majority of attacks, which are automated attempts with stolen passwords. Keep them, and move the accounts that matter to passkeys or a security key.

What Are the Downsides of 2FA?

There are real ones, and pretending otherwise is how people end up turning it off.

Lockout. Lose the phone with your only authenticator app and, without backup codes, you are into an identity-recovery process that can take days. This is the genuine cost, and backup codes plus a second method reduce it to nothing.

Friction. Ten extra seconds, several times a day. Trusted-device settings, where the service remembers your own laptop for thirty days, remove most of it without removing the protection.

Shared accounts. A team login tied to one person's phone breaks the day that person is on a plane. The fix is individual accounts with individual factors, not a shared code.

A new phone. Authenticator apps that do not sync will not migrate themselves. Export or re-enroll before wiping the old device, not after.

Two-Factor Authentication for Business Accounts

The help desk is where this year's incidents keep landing. Two reports on this site describe attacks that never touched the cryptography at all.

Key takeaways

  • Two-factor authentication needs proof from two different categories: something you know, something you have, something you are. A password plus a security question is not 2FA.
  • It makes a stolen password useless on its own, which is what most attacks are working with.
  • The forms are not equal. Passkeys and security keys resist phishing, authenticator apps do not, and text message codes are the weakest of all.
  • A relay page can lift a one-time code in seconds. Only a factor bound to the real domain breaks that chain.
  • Save the backup codes when you turn it on. Lockout, not attack, is the most common bad outcome.
  • Nobody legitimate asks for your code. That request, in any form, is the attack.

Common questions

What is two-factor authentication in simple words?

A login that needs two things instead of one: your password, plus proof that you are holding your phone or your security key. If someone steals the password, they still cannot get in, because they do not have the second thing.

How do I get a two-factor authentication code?

From an authenticator app, which generates one every thirty seconds without needing a signal; from a text message or automated call; or from the backup codes the service gave you at setup. Push prompts replace the code with an approve button.

Where can I find my 2FA settings?

In your account's security settings, usually reached from the profile menu, then Security or Sign-in. It is labeled two-factor authentication, two-step verification or login verification depending on the service. On Apple accounts it is on by default, under your sign-in and security page.

What are the downsides of 2FA?

Lockout if you lose the device and never saved backup codes, a few seconds of friction per login, and trouble with shared team logins. All three are solvable: save the codes, enroll a second method, and give each person their own account.

Is 2FA no longer secure?

It is still the highest-value control you can switch on, and it still blocks the automated attacks that run on stolen passwords. What changed is that phishing pages now relay one-time codes in real time. Passkeys and security keys are the answer to that, because they refuse to work on the wrong domain.

What is the difference between 2FA and MFA?

2FA means exactly two factors, MFA means two or more, and all 2FA is MFA. Consumer services say 2FA or two-step verification, businesses say MFA, and the question that matters for both is whether one factor resists phishing.

What happens if I lose my phone with the authenticator app on it?

Use a backup code, or a second enrolled method such as a security key or another device. Failing that you go through account recovery, which means identity checks and a wait of hours to days. This is the case for saving backup codes on day one.

Is SMS two-factor authentication safe?

Safer than no second factor, and the weakest option on the menu. Text codes can be intercepted through weaknesses in the phone network or captured after a SIM swap, and Google notes on its own help pages that they can be vulnerable to phone number-based attacks. Move email and banking off it first.

Do I still need a strong password if I have 2FA?

Yes. The second factor is a backstop, not a replacement. Attacks usually start by testing a password that leaked elsewhere, and some older protocols fall back to the password alone. Unique passwords from a password manager, plus 2FA, is the pairing that works.

What is a passkey?

A private key stored on your phone, laptop or password manager that signs a challenge from the site instead of sending a secret. Your fingerprint or face unlocks it locally. It checks the domain before signing, so a fake login page gets nothing, which is why it counts as phishing-resistant where codes do not.

On this page
Reviewed by

Daniel Reyes

  • CISSP
  • 12 years in security operations
  • Austin, TX

Daniel Reyes is a CISSP who spent twelve years in security operations, most recently leading a detection and response team for a mid-sized healthcare group in Texas. He reviews every resource and breach report on Cyber Security Firms for technical accuracy before it publishes.

Most of the people he has trained arrived having been told too much: a dozen acronyms, six vendors, and no clear idea which risk was theirs. His approach is to explain what an attack actually does before naming the tool that stops it, on the basis that most breaches start with something a reader could have recognised.

Read the full bio and how we research →