Skip to main content
Tools2fa-authenticator7 min read

SMS codes vs authenticator apps vs passkeys: which is safest?

NIST treats SMS codes as a restricted authenticator and says typed codes are not phishing-resistant. How each 2FA method works and where passkeys fit.

Published

Cover banner: SMS codes vs authenticator apps vs passkeys: which is safest?, with the free 2FA Authenticator

Any second factor is better than a password alone, but they are not equal. Codes sent by SMS are the one method NIST classes as "restricted". Authenticator-app codes avoid the phone network but can still be phished, because you type them in. Passkeys are phishing-resistant, and the UK's NCSC now calls them the first choice wherever a service offers them.

This is general information, not advice. Which methods you can use depends on what each service supports; the rankings below come from the published guidance, not from tests of any provider.

How time-based codes work

Authenticator apps implement RFC 6238 (May 2011), the time-based one-time password (TOTP) standard. You and the service share a secret key once, usually by scanning a QR code. After that, both sides take the current Unix time, divide it into steps (30 seconds by default), and run the step number and the secret through HMAC; the result is cut down to six or eight digits. Because both sides compute the same thing, no code ever travels over the phone network.

We ran the RFC's own test key through the AltFTool 2FA Authenticator's code. It reproduces the published 8-digit values exactly:

Unix time (seconds)Date (UTC)RFC 6238 expected (SHA-1)2FA Authenticator output
591970-01-019428708294287082
11111111092005-03-180708180407081804
11111111112005-03-181405047114050471
12345678902009-02-138900592489005924

The six-digit codes most sites use are the last six digits of the same calculation, for example 287082 for the first row.

Why SMS codes rank lowest

NIST SP 800-63B-4, the final version of which NIST released in July 2025 (see NIST's SP 800-63-4 release page), says that at the time of publication there is one restricted authenticator: using the public telephone network (SMS or voice) for out-of-band codes. An organisation that accepts it must offer at least one unrestricted alternative, tell users about the risks, and plan for the day it is no longer acceptable. NIST also says verifiers should consider risk signs such as a device swap, a SIM change or number porting before sending a code that way.

The weakness is the channel: the code is only as safe as the phone number it is sent to. That said, the NCSC's 2-step verification guidance notes that codes are often sent by SMS and still recommends turning 2SV on for important accounts, because it keeps criminals out even when they know the password. In the NCSC's view, even a code by SMS keeps out someone who only knows the password.

Phishing resistance: where passkeys pull ahead

NIST is direct about typed codes: authenticators "that involve the manual entry of an authenticator output (e.g., out-of-band and OTP authenticators) SHALL NOT be considered phishing-resistant". A fake login page can ask for your code and pass it to the real site within its 30-second window. Phishing resistance needs cryptographic authentication bound to the real site, which is what passkeys provide.

MethodPhishing-resistant under NIST SP 800-63B-4?Note
SMS or voice codeNoThe one restricted authenticator; depends on the phone number
Authenticator app (TOTP)NoNo phone network, but the code can be relayed by a fake site
Saved recovery codesNoLook-up secrets for when another factor is lost
Passkey or security keyYes, when it meets section 3.2.5Cryptographic, bound to the site's name

NIST also requires services at its AAL2 level to offer at least one phishing-resistant option. It treats passkeys that sync across your devices as "syncable authenticators", acceptable at AAL2 but not at AAL3, because the key can be copied to other devices.

In its passkeys announcement of 23 April 2026, the NCSC said that passkeys should be consumers' first choice of login, citing its technical report that passkeys are "at least as secure as, and generally more secure than, pairing the strongest password with two-step verification". Where a service does not support passkeys, its advice is to use a password manager and keep using 2SV.

2FA Authenticator

Generate RFC 6238 time-based codes in your browser for accounts that use an authenticator app.

Open 2FA Authenticator

Backup codes and changing phones

Losing or replacing a phone is a common way to lose access to codes. NIST describes saved recovery codes as secrets of at least 64 bits that are "intended to be maintained offline (e.g., printed or written down) and stored securely", and says a service must invalidate a code once used and issue a new one. Authenticator accounts that are not moved before a phone change can leave no way to sign in, unless another method such as recovery codes is set up. The Recovery Code Storage Planner checks a backup plan against the 3-2-1 rule and flags two traps: codes kept on the same device as the authenticator, and codes stored only inside the password manager they unlock.

What a browser-based authenticator protects, and what not

The AltFTool 2FA Authenticator keeps secrets in your browser, not on a server. Its vault code encrypts them with AES-256-GCM, either under a non-extractable device key or under a key derived from a passphrase you set (PBKDF2-SHA256, 600,000 iterations). That protects the stored secrets, but it does not change NIST's point: a typed code can still be phished, because a fake page on a different address can still collect a typed code. Browser storage can also be cleared, which is another reason to keep recovery codes offline. A strong, unique password from the password generator remains the first layer.

Frequently asked questions

In NIST SP 800-63B-4, SMS and voice codes are the one restricted authenticator, while app codes are not restricted. Neither is phishing-resistant, because both are typed in.

The NCSC says passkeys are at least as secure as, and generally more secure than, the strongest password with two-step verification, and NIST counts suitable cryptographic authenticators as phishing-resistant.

The NCSC recommends 2-step verification on important accounts and notes that codes are often sent by SMS. NIST restricts SMS and voice codes but not app codes, and counts suitable passkeys as phishing-resistant.

Every 30 seconds by default under RFC 6238, which defines the time step X as a system parameter with a default of 30 seconds.

NIST describes saved recovery codes as meant to be kept offline, for example printed or written down, and stored securely. Each code works once, and a service must issue a new one after use.

Sources and notes

Links the author listed for this post.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5

Reader feedback

Was this guide helpful?

Your signal helps the editorial team improve stale or unclear guides faster.

Found this useful? Pass it on.

Share this article

Written by

TOTP codes generated with the 2FA Authenticator's code (src/tools/2fa-authenticator/lib/totp.js) on 2026-11-13 and checked against the RFC 6238 Appendix B test vectors; storage details read from src/tools/2fa-authenticator/lib/vault.js. NIST, NCSC and RFC texts opened on 2026-11-13. This is general information, not advice. Re-check by 2027-05-12.

Your inbox, your topics

What do you want more of?

Pick the topics you'd like in your inbox. We've ticked one that matches this guide — change them freely.

Topics you want more of

Up to 200 characters.

Privacy policy

Discussion

0 comments

Loading discussion