工具 · 安全与双因素认证

2FA TOTP 双因素令牌生成器

从 Base32 密钥实时生成双因素认证动态码。完全遵循 RFC 6238 标准,数据 100% 留存在浏览器内部。

100% Client-Side RFC 6238 (Zero Network Calls)
Current 6-Digit 2FA Passcode
30s
--- ---
01 / DRIFT TOLERANCE

Allow ±1 Time Step Verification

Server clocks and user mobile phones can drift by several seconds. Production TOTP verifiers must always check the current 30s window plus ±1 interval (3 total steps) to prevent frustrating login failures.

02 / REPLAY ATTACKS

Invalidate Used Codes Immediately

Even though a TOTP code remains mathematically valid for 30 seconds, your backend must store recently verified codes in a high-speed Redis cache and immediately reject duplicate submissions within the same window.

03 / RECOVERY

Backup Scratch Codes Are Mandatory

Never enroll a user into 2FA without simultaneously issuing 8 to 10 single-use cryptographically hashed recovery scratch codes. Lost authenticator devices without recovery fallback lead to permanent account lockouts.