Multi-Factor Authentication: TOTP Mechanics, FIDO2 & WebAuthn

Passwords are fundamentally broken. Users reuse them across multiple sites, create easily guessable variants, and fall victim to phishing lures. Multi-Factor Authentication (MFA) is an identity verification methodology that requires a user to supply two or more independent credentials across different authentication categories before access is granted. Microsoft research indicates that enabling MFA stops over 99.2% of automated account compromise attacks!

The Three Classical Authentication Factors

  • 1. Something You Know (Knowledge): Passwords, PINs, passphrases, security questions.
  • 2. Something You Have (Possession): Smartphone (TOTP app), hardware security key (YubiKey), smart card.
  • 3. Something You Are (Inherence): Biometrics (Fingerprint, Apple FaceID, Iris scan).

Note: Requiring a password plus your mother's maiden name is NOT Multi-Factor; that is simply Two-Step Verification using two items from the same factor (Knowledge).

Why SMS-Based 2FA is Insecure: SIM Swapping

While receiving a 6-digit code via SMS is better than no 2FA at all, security agencies (including NIST) strictly discourage SMS-based authentication for sensitive systems. Attackers execute SIM Swapping: they impersonate the victim, call the telecommunications carrier (e.g. Verizon/AT&T), claim their phone was lost, and trick the customer service rep into porting the victim's phone number to an attacker-controlled SIM card, intercepting all SMS verification codes.

Time-Based One-Time Passwords (TOTP RFC 6238)

Mobile authenticator apps (Google Authenticator, Microsoft Authenticator) operate offline without cellular connectivity using the TOTP algorithm:

// TOTP Formula:
TimeStep = floor( CurrentUnixTimestamp / 30 )
TOTP_Code = Truncate( HMAC-SHA1( SharedSecretKey, TimeStep ) ) mod 10^6

The server and the smartphone share a secret seed key (exchanged via QR code during setup). Every 30 seconds, both devices independently calculate the exact same 6-digit code. Because codes expire every 30 seconds, intercepted codes become useless almost immediately.

The Gold Standard: FIDO2 / WebAuthn Passkeys

Even TOTP codes can be phished by modern reverse-proxy toolkits (like Evilginx). FIDO2 WebAuthn eliminates phishing mathematically using public key cryptography:

Why FIDO2 WebAuthn is 100% Phishing-Proof

During WebAuthn authentication, the browser cryptographically binds the authentication assertion to the exact origin domain in the URL address bar. If an attacker tricks you into visiting https://paypa1-phishing.com, the hardware key calculates the signature for that phishing domain. When the attacker forwards that signature to real paypal.com, PayPal's server rejects it immediately because the domain signatures do not match!

Frequently Asked Questions (FAQ) - Student & Interview Review

Q1. What are Backup / Recovery Codes in MFA?

Backup codes are a set of single-use, high-entropy cryptographic recovery strings provided during MFA setup. If a user loses their physical phone or hardware key, a backup code allows emergency one-time account recovery.

Q2. What is MFA Fatigue (Push Bombing)?

An attack where the adversary repeatedly triggers hundreds of mobile push notifications in the middle of the night until the frustrated user accidentally clicks 'Approve' to silence their phone. Defended by requiring 'Number Matching' on screen.

Explore Related Cybersecurity Tutorials & Next Steps

Broaden your defensive and offensive security knowledge across our curriculum:

Authentication Failures & Passwords

Why traditional passwords fail and how MFA closes 99.9% of account takeovers.

OAuth 2.0 & Identity Providers

Integrating MFA into centralized Single Sign-On (SSO) authentication flows.

Social Engineering & SIM Swapping

Why SMS MFA is vulnerable to SIM swaps and why FIDO2 WebAuthn is preferred.

Cybersecurity Developer Cheat Sheet

Quick comparison table of MFA factors: Knowledge, Possession, and Inherence.

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Reddit

You may also like this!