TOTP 2FA: How It Works and Where to Store It

2026-10-19 · Updated 2026-10-19 ·

TOTP 2FA: How It Works and Where to Store It

Many login pages add one more step after the password: open the phone, find the entry, copy six digits, wait for the code to refresh. That six-digit code is usually TOTP, a time-based one-time password. It is more reliable than SMS, and it is often misunderstood as "absolute security".

This post covers three things: what TOTP actually computes, whether putting it in a password manager is a good trade-off, and the migration mistakes to avoid.

What TOTP computes

TOTP is defined by RFC 6238. When you enroll in two-step verification, the service generates a shared secret and gives it to you, usually as a QR code or a text string. On every login:

  1. The client and the server both take that shared secret;
  2. They add the current time window (30 seconds by default) as a counter;
  3. They run an HMAC and truncate the result into six digits;
  4. The server compares the result, allowing a small clock drift.

The code is not random. It is a deterministic result of secret + time. It needs no network and no SMS; as long as both clocks are close, both sides compute the same code.

TOTP vs SMS vs passkeys

TOTP is a practical second factor today, not the final answer. For high-value accounts, prefer a passkey or hardware key where available.

TOTP inside a password manager: convenience and risk

Keeping TOTP with the password removes the context switch: after filling the password, the current code is right there. For developers and QA engineers logging into many admin panels, that is a real improvement.

Be clear about the risk:

Account Password Helper stores the TOTP secret as a separate encrypted field alongside the username, password, URL and remark; codes are generated locally per RFC 6238 and can be filled at the second login step. It is designed for convenient management of everyday and multi-environment accounts, not as the only vault for banking or payment credentials.

Migrating TOTP secrets

There are usually three ways to move from a phone authenticator to another tool:

  1. Scan a QR code from the old tool or the service;
  2. Enter the Base32 secret manually, together with the account name, issuer and algorithm parameters;
  3. Export/import where supported; remember that the export file itself is highly sensitive.

A safe migration order:

Never send TOTP QR codes, secret screenshots or recovery codes through chat. They are credentials that can generate valid codes.

How TOTP works inside a browser extension

In Account Password Helper:

A browser extension runs inside your browser; it cannot defend against a compromised operating system, a malicious extension or a shared screen. Before screen sharing or remote support, make sure the code page is out of the shared area.

Checklist

The value of TOTP is an independent second factor, not an absolute wall. Understanding how it computes and where the trust boundary sits keeps the convenience in your workflow and the risk within a range you control.

For the local encryption and key-management details, read Web Crypto in practice. If your daily logins need built-in TOTP and one-click fill, try Account Password Helper.