TOTP & HOTP

TOTP (Time-based One-Time Password, RFC 6238) e HOTP (HMAC-based One-Time Password, RFC 4226) sono i due RFC che ogni QR di iscrizione 2FA implementa. Lo schema URI otpauth:// codificato è lo standard de facto di Google Authenticator, universale su tutte le principali app di autenticazione.

Specifica TOTP:RFC 6238 (basato sul tempo, 2011).
Specifica HOTP:RFC 4226 (basato su contatore, 2005).
Schema URI:Google Authenticator Key URI Format, il formato su cui tutti gli autenticatori concordano.

Cos'è

Un QR di iscrizione 2FA è un URL nello schema otpauth:// che porta il segreto condiviso più metadati identificativi. Formato:

otpauth://TYPE/LABEL?secret=SECRET&issuer=ISSUER&algorithm=ALG&digits=N&period=SEC

Vettori di test canonici

CasoInputURI otpauth:// atteso
TOTP, minimale (SHA1, 6 cifre, 30 s)issuer=GitHub
account=alice@example.com
secret=JBSWY3DPEHPK3PXP
otpauth://totp/GitHub:alice@example.com?secret=JBSWY3DPEHPK3PXP&issuer=GitHub
TOTP, SHA256, 8 cifreissuer=Corp
account=bob
secret=JBSWY3DPEHPK3PXP
algorithm=SHA256
digits=8
otpauth://totp/Corp:bob?secret=JBSWY3DPEHPK3PXP&issuer=Corp&algorithm=SHA256&digits=8
HOTP, counter=0issuer=YubiKey
account=carol
secret=JBSWY3DPEHPK3PXP
counter=0
otpauth://hotp/YubiKey:carol?secret=JBSWY3DPEHPK3PXP&issuer=YubiKey&counter=0
TOTP, segreto di riferimento RFC 6238issuer=Example
account=test
secret=GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ
digits=8
Segreto di test RFC standard (12345678901234567890). Produce TOTP 94287082 a T=59 s.

Validatore di segreto Base32 live

Le app di autenticazione rifiutano i segreti che contengono qualcosa al di fuori dell'alfabeto Base32 (A-Z, 2-7). Di seguito è lo stesso validatore che Abundera esegue nel generatore TOTP, gira nel tuo browser.

Inserisci un segreto da validare.

Insidie comuni

Compatibilità delle app di autenticazione

AppTOTP SHA1TOTP SHA256/512HOTP8 cifreNote
Google AuthenticatorIgnoratoIgnoratoLa baseline de facto. Puntare sempre a questo per primo.
1PasswordSupporto RFC completo.
AuthyNoHa rimosso HOTP nelle versioni recenti.
BitwardenSupporto RFC completo.
Microsoft AuthenticatorSupporto RFC completo.
YubiKey AuthenticatorHOTP è il modo canonico di YubiKey.
Duo MobileIgnoratoNoIgnoratoUsa il proprio flusso push; TOTP è solo fallback.

Vedi anche

Riferimenti alle specifiche verificati il 2026-04-18. RFC 6238 (2011), RFC 4226 (2005), Google Key URI Format.