Two-Factor Authentication: What It Is and How to Set It Up
Security

Two-Factor Authentication: What It Is and How to Set It Up

M
Marcus Thorne · ·7 min read

Passwords alone are no longer sufficient protection for your accounts. Data breaches happen constantly — billions of credentials are available on the dark web, and attackers use automated tools to try them against popular services around the clock.

Two-factor authentication (2FA) is the single most effective thing you can do to protect your accounts beyond a strong password. Even if an attacker has your exact username and password, 2FA stops them at the door.

What Two-Factor Authentication Is

Authentication is the process of proving you are who you claim to be. Traditional authentication uses one factor: something you know (your password).

Two-factor authentication requires a second factor on top of your password. The three categories of factors are:

  • Something you know — password, PIN
  • Something you have — your phone, a hardware security key
  • Something you are — fingerprint, face ID

2FA combines two of these. The most common implementation: password (something you know) + a time-based code on your phone (something you have). Even if someone steals your password, they can’t log in without also having your phone.

Types of 2FA: Best to Worst

Not all 2FA is equally secure. From strongest to weakest:

Hardware Security Keys (Best)

Physical devices like YubiKey or Google Titan Key that you plug in or tap against your phone. Immune to phishing because they cryptographically verify the website’s identity before responding. If you’re on a fake login page, the key won’t authenticate.

The gold standard. Recommended for high-value accounts: Google Workspace, GitHub, financial accounts. Cost: $25–$60 for a key.

Authenticator Apps (Recommended for Most People)

Apps like Authy, Google Authenticator, or the built-in authenticators in 1Password and Bitwarden generate time-based one-time passwords (TOTP) — 6-digit codes that change every 30 seconds. The code is generated on your device and never transmitted to a server, so there’s nothing to intercept.

To set up: scan a QR code shown by the service during 2FA enrollment. The app and the server sync a secret and independently generate the same rolling codes.

This is the right choice for most people. It’s free, works offline, and is significantly more secure than SMS.

SMS Text Messages (Weak — But Better Than Nothing)

Many services send a 6-digit code via text message. This is better than no 2FA, but it has real weaknesses:

SIM swapping: Attackers can call your mobile carrier, impersonate you, and have your phone number transferred to a SIM they control. They then receive your SMS codes.

SS7 attacks: Weaknesses in the cellular network protocol can allow interception of SMS messages.

Phone loss/theft: Anyone with your unlocked phone can receive SMS codes.

Use SMS 2FA if it’s the only option available. Prefer authenticator apps whenever both are offered.

Email-Based Codes (Weakest)

Some services send codes to your email. This is only as secure as your email account — which is exactly what attackers are often trying to compromise in the first place.

Setting Up an Authenticator App

Step 1: Download an authenticator app

  • Authy — free, backs up codes to the cloud (encrypted), works across multiple devices. Good default choice.
  • Google Authenticator — simple, free, no cloud backup (codes only exist on your device).
  • 1Password / Bitwarden — if you use these password managers, they have built-in TOTP. Convenient, though combining password and 2FA in one app reduces some security separation.

Step 2: Enable 2FA on an account

Go to an account’s security settings. Look for “Two-factor authentication,” “Two-step verification,” or “Authenticator app.” Most services show a QR code during setup.

Step 3: Scan the QR code

In your authenticator app, tap the + button and choose “Scan QR code.” Point your camera at the QR code on screen. The account is now added to your app.

Step 4: Verify it works

The service will ask you to enter a code from your app to confirm setup. Enter the 6-digit code shown — it changes every 30 seconds, so enter it promptly.

Step 5: Save your backup codes

Every service that offers 2FA provides backup codes — single-use codes for account recovery if you lose your phone. Save these. Print them and store with important documents, or save in a secure note in your password manager. Losing your phone without backup codes can permanently lock you out.

Accounts to Prioritize

Enable 2FA everywhere it’s offered. Prioritize in this order:

  1. Email — controls password resets for everything else. This is your most critical account.
  2. Password manager — protects all other credentials.
  3. Banking and financial accounts — direct financial risk.
  4. Work accounts — email, Slack, GitHub, cloud services.
  5. Social media — account takeovers are used for fraud and harassment.
  6. Domain registrar and hosting — if your domain gets taken, your email and website go with it.

What 2FA Doesn’t Protect Against

2FA is powerful but not invincible:

Real-time phishing attacks: Sophisticated attackers create fake login pages that relay your credentials and 2FA codes to the real site in real time. You enter your code, they enter it simultaneously on the real site. Hardware security keys are immune to this; TOTP apps are not.

Malware on your device: If your phone has malware that reads your screen or intercepts app data, 2FA codes can be captured. Device security is the underlying foundation.

Account recovery weaknesses: If a service allows resetting 2FA via email or SMS, those channels become the weakest link. Choose services with robust recovery processes.

Social engineering: Attackers sometimes call customer support, impersonate the account holder, and convince support agents to disable 2FA. Strong account PINs with carriers and services help here.

If You Lose Your Phone

If you lose your phone and have 2FA enabled:

  1. Use your backup codes (this is why you saved them)
  2. Access through a secondary device if using Authy (it supports multi-device)
  3. Use account recovery processes — these typically require identity verification and can take days. A good reason to keep backup codes current.

Enable 2FA on your email account today, then work through the priority list. Authenticator app 2FA on your email and password manager alone dramatically reduces your risk of account takeover. It takes five minutes per account to set up and provides protection that even sophisticated attacks struggle to defeat.

M

Written by Marcus Thorne

Software analysis and cybersecurity tips

A former software engineer, Marcus transitioned into tech journalism to explain complex digital concepts in simple terms.

You Might Also Like