Two-factor authentication (2FA) is a login method that requires evidence from two independent categories before access is granted: typically something the user knows, such as a password, plus something the user has, such as a phone generating codes or a hardware security key. The point of the second factor is that an attacker who steals one kind of evidence still lacks the other. With a correctly enforced two-factor flow, a leaked password alone should not be sufficient; security also depends on protecting the second factor and recovery path.
The word independent carries the definition. Two pieces of evidence from the same category, such as a password followed by a PIN, make an attacker guess twice but do not change what kind of theft succeeds. Both NIST's digital identity guidelines and the OWASP authentication guidance treat two instances of the same factor as single-factor authentication with an extra step.
Authentication Factors
Security guidance recognizes three factor categories:
- Something you know: a password, passphrase or PIN. Security questions used to be counted here; current NIST guidance no longer accepts them.
- Something you have: a device or object such as a phone running an authenticator app, a hardware token, a smart card or a security key.
- Something you are: a biometric such as a fingerprint or face scan. NIST treats biometrics as usable only together with a physical authenticator, because a biometric is a probabilistic match rather than a secret.
Location, IP address, time of day and behavioral patterns are often listed as additional factors. OWASP classifies them as risk signals that can inform a decision or restrict access, not as independent factors in their own right. A service that checks a password and then notices an unfamiliar country has gained context, not a second factor.
Independence also fails in subtler ways. A code sent by SMS to the same phone that is being used to log in belongs to a second category, yet one device compromise exposes both at once.
Codes, Security Keys and Passkeys
One-Time Codes
The most familiar second factor is a six-digit code that changes every 30 seconds. Authenticator apps implement TOTP, the time-based one-time password algorithm of RFC 6238: the app and the server share a secret seed at enrollment, and each computes an HMAC over the current time step, so the code proves possession of the seed without transmitting it. Verifiers tolerate a small amount of clock drift and must reject a code once it has been used. SMS and voice codes deliver a server-generated value over the phone network instead; NIST classes this out-of-band channel as restricted because of SIM-swap and number-porting attacks, and OWASP advises against it for financial or sensitive applications. All code-based methods share one weakness: a user can be tricked into typing a valid code into a counterfeit site, which replays it within the validity window.
Security Keys
A FIDO security key is a small hardware device, usually USB or NFC, that holds private keys and signs a challenge from the service when the user touches it. Because the signature is bound to the origin of the site requesting it, a lookalike domain cannot obtain a valid authentication response for the legitimate site. NIST describes this property as phishing resistance and requires it at its highest assurance level, where the private key must also be non-exportable. The trade-offs are cost, the need to carry the device, and the fact that a key without a PIN or biometric works for anyone who holds it.
Passkeys
Passkeys are FIDO credentials based on the same public-key mechanism as security keys but managed by the operating system or a credential manager and unlocked with the device's own PIN or biometric. The FIDO Alliance distinguishes synced passkeys, which are backed up and shared across a user's devices through a platform account, from device-bound passkeys that never leave one device, including those stored on security keys. A passkey can serve as the second factor after a password or replace the password entirely, when control of the credential is combined with a verified device PIN or biometric. Whether a deployment counts as multi-factor depends on the service checking that user verification occurred, and NIST excludes syncable authenticators from its top assurance level because their keys are exportable by design.
2FA vs Two-Step Verification and MFA
Multi-factor authentication (MFA) is the general term for requiring two or more independent factors; 2FA is the specific and most common case of exactly two. The MFA vs 2FA distinction is therefore one of scope, not kind: every 2FA login is MFA, while a scheme requiring a password, a security key and a fingerprint is MFA but not 2FA.
Two-step verification is a looser phrase. Some services use it as a synonym for 2FA; others use it for any login that happens in two stages, even when both stages draw on the same category. A password followed by a security question has two stages but still relies on knowledge. Email codes introduce separate concerns about mailbox access; NIST does not accept email as an out-of-band authenticator. The label a product uses is less informative than the question of what an attacker would need to steal.
Account Recovery and Backup
A second factor that can be lost needs a recovery path, and that path is part of the security boundary. Services commonly issue a set of single-use recovery codes at enrollment, allow several authenticators to be registered so that one can be lost, or fall back to a verified support process. OWASP notes that no single recovery method suits every application, and that changing or removing a factor should itself require re-authentication with an existing factor rather than just an active session.
Recovery codes need a secure location that remains accessible if the primary device is lost. Printed copies kept safely offline or protected storage on another device can provide that separation. A password manager is convenient, but storing the password and recovery codes in the same vault makes vault security especially important. Each code is spent once used. For teams managing many accounts, TOTP seeds and recovery codes are shared secrets in the literal sense; how they are stored, rotated and revoked when someone leaves decides whether 2FA still means anything.
Common Uses and Limitations
Two-factor authentication is standard for email, banking, cloud consoles, developer platforms and administrative access, and many services require it for accounts with elevated permissions. For teams managing several accounts, each enrollment and recovery route must be documented clearly enough to avoid locking an account when a device is replaced or an employee leaves. An authenticator app can hold separate credentials for many accounts; the app itself is not a single shared factor sent to every service.
Its limitations are real but specific. Code-based 2FA is phishable in real time; phishing-resistant cryptographic methods, including FIDO security keys and passkeys, address that threat. Lost devices without recovery options cause lockouts. A stolen, usable session cookie may let an attacker act within an existing session without repeating 2FA. Session expiry, revocation, device binding and re-authentication for sensitive actions can limit that exposure. And a weak recovery flow, such as resetting the second factor through an SMS code, quietly reduces the whole scheme to the strength of its weakest path.