Foundations · Wallets & Security

Two-Factor Authentication

Two-factor authentication (2FA) adds a second proof of identity to a password when signing in. Authenticator apps and hardware security keys are generally stronger second factors than SMS codes.

  • Beginner
  • 5 min read
  • Updated

Why it matters

Passwords leak. They are reused across sites, captured by phishing pages and exposed in data breaches. An account protected by a password alone is protected by a secret that may already be known to others.

Two-factor authentication, or 2FA, requires a second and different kind of proof. It is one of the most effective protections for accounts on a centralized exchange and for the email account behind it. The methods are not equally strong, and the differences matter most to exactly the people attackers target.

How it works

Signing in with two factors
  1. PasswordSomething you know.
  2. Second factorSomething you have: a code, an app or a key.
  3. AccessGranted only when both are correct.
A stolen password alone is no longer enough to open the account.

Authentication factors fall into three families: something you know (a password or PIN), something you have (a phone, a device or a key) and something you are (a fingerprint or a face). Two-factor authentication combines two different families, so that stealing one is not enough.

In plain words

A cash machine already works this way. The card is something you have and the PIN is something you know. A thief with only the card, or only the PIN, gets nothing.

The common methods

Common second factors, from more exposed to less exposed
SMS or voice codeSent to a phone number. Exposed to SIM swaps and can be phished.
Email codeOnly as strong as the email account itself.
Authenticator appCodes generated on the device. Not tied to the phone number. Can still be phished.
Hardware security key or passkeyChecks the website's real address before responding. Resists phishing.
Any second factor is generally better than a password alone. The differences are in what each one can be tricked by.

SMS codes. The service sends a code by text message. This ties the account’s security to a phone number, and a phone number is controlled by the mobile carrier, not by its user.

Authenticator apps. During setup, the service shows a QR code containing a secret, which the app stores. From then on the app calculates a short code from that secret and the current time, commonly six digits that change every 30 seconds. It works without any network connection, and nothing is sent to the phone number.

Hardware security keys. A small physical device that is registered with the account and tapped or plugged in at sign-in. The key checks the address of the website asking and only answers the genuine one. Passkeys, built into phones and computers, use the same underlying approach.

SMS code Authenticator app Security key or passkey
Exposed to a SIM swap Yes No No
Can be typed into a fake site Yes Yes No
Needs a mobile signal Yes No No
If the device is lost Number can be restored by the carrier Backup codes or the saved setup secret are needed A second registered key or backup codes are needed

The SIM swap

A SIM swap, as the victim sees it
  1. No signalThe phone suddenly loses service for no clear reason.
  2. Number movedThe mobile carrier was persuaded to move it to another SIM.
  3. Codes redirectedText-message codes and reset links now reach the attacker.
  4. Accounts openedEmail first, then everything that email can reset.
The phone was never stolen and no password was guessed. The phone number itself changed hands.

In a SIM swap, an attacker convinces a mobile carrier’s staff that they are the customer and has the phone number moved to a SIM card they control. Text-message codes and password-reset links then go to the attacker. This is the main reason SMS is regarded as the weakest of the common second factors.

Going deeper

Codes can be phished in real time. A fake sign-in page can ask for the password and the current code and pass both to the real site within seconds. Authenticator codes do not stop this. Security keys and passkeys do, because they will not respond to the wrong address.

The setup secret is the factor. The QR code shown when an authenticator app is set up is the secret from which every future code is calculated. A screenshot of it is a copy of the second factor.

Backup codes. Most services issue one-time backup codes for when the device is lost. They bypass the second factor by design and need the same care as a password.

Email is the root. Almost every account can be reset through its email address. An email account with weak protection undoes strong protection everywhere else.

Not for self-held wallets. 2FA protects accounts held with a company. A non-custodial wallet has no sign-in to protect: whoever has the seed phrase has the wallet, and ordinary 2FA does not apply. A passphrase or a multi-signature setup can add an extra layer. See custodial and non-custodial wallets.

A hypothetical evening without signalHypothetical illustration

Elena’s phone shows “No service” at seven in the evening. She assumes a network fault and goes to bed.

During the night, someone who has had her number moved to their own SIM uses “forgot password” on her email account. The reset code arrives by text message, on their phone. From her mailbox they reset the password of her exchange account, which also uses SMS codes, and request a withdrawal.

Change one detail. If the exchange account had used an authenticator app or a security key, control of the phone number would not have produced the second factor, and the sign-in would have stopped there.

In both versions, the sudden loss of signal was the earliest visible sign.

What it does NOT mean

  • 2FA does not make an account unbreakable. It removes the simplest attacks and leaves phishing, malware and recovery fraud.
  • All second factors are not equal. A text-message code and a hardware key resist very different things.
  • A code is not safe to share with “support”. Nobody but the service’s own sign-in page has any use for it. See fake support and impersonation.
  • 2FA does not protect a seed phrase. Self-held wallets have no ordinary second factor.

Common mistakes

  1. Leaving SMS as the fallback. A stronger method does little if the account can still be recovered by text message.
  2. Photographing the setup QR code. The image is a working copy of the authenticator.
  3. Having no backup. A lost phone with no backup codes can mean a long lockout.
  4. Protecting the exchange and neglecting the email. The email account can reset the exchange password.

Risks and limitations

  • Every method can lock out its owner. Stronger factors generally make recovery harder.
  • Not every service supports security keys or passkeys, and options differ between exchanges.
  • Malware on a signed-in device can act inside a session after the second factor has been passed.
  • The strength of the whole setup is set by its weakest recovery path.

Key takeaway

Two-factor authentication adds a second proof to a password. Authenticator apps and hardware security keys are generally stronger than SMS codes, which are exposed to SIM-swap attacks, and no second factor protects a seed phrase.

Sources and further reading