Skip to main content
DevTools24

TOTP 生成器

为双因素认证生成基于时间的一次性密码。创建与 Google Authenticator、Authy 和其他 TOTP 应用兼容的 QR 码。

About TOTP

  • TOTP (Time-based One-Time Password) generates codes that change every 30 seconds
  • The secret key should be kept secure - anyone with it can generate codes
  • Used for two-factor authentication (2FA) to enhance account security
  • Based on RFC 6238 and uses HMAC-SHA1 by default

Time-based One-Time Passwords - 技术详情

TOTP is an algorithm that generates one-time passwords using the current time and a shared secret. It's the standard behind Google Authenticator and most 2FA apps. Codes change every 30 seconds by default.

命令行替代方案

# Generate TOTP with oathtool
oathtool --totp -b JBSWY3DPEHPK3PXP

# Or use Node.js
npm install otplib
node -e "console.log(require('otplib').authenticator.generate('JBSWY3DPEHPK3PXP'))"

参考

查看官方规范