TOOLTIKI Lovable tool, really free
Developer Security

TOTP secret generator

Strength Excellent
160 bits of entropy · guessed in about 2,315,609,611,204,437,200,000 eons

Generated in your browser · never sent, never stored

Local · 160 bits, base32, RFC 4648
Advertisement
320 × 100

Time-based one-time passwords work from a secret both the server and the authenticator app hold. This generates that secret: 160 random bits, base32-encoded without padding, which is the form every authenticator app expects.

How to generate a TOTP secret

1 Fill in the issuer — your service’s name — and the account it belongs to. Both appear in the user’s authenticator app.
2 Copy the base32 secret for your own storage, and the otpauth URI for the QR code you show the user.
3 Store the secret encrypted at rest. Anyone holding it can generate valid codes.

The defaults in the URI — SHA-1, six digits, a thirty-second period — look dated, and they are, but they are what RFC 6238 specifies and what every mainstream authenticator implements. Deviating breaks compatibility for no security gain, because the secret’s 160 bits are what carries the strength here, not the hash. The one thing worth knowing about handling: the secret is a symmetric key. If your database leaks it, an attacker generates codes as easily as the user does, so it needs the same protection as a password hash and rather more than a session token.

Questions

RFC 4226 requires at least 128 bits and recommends 160. This generates 160, which is 32 base32 characters.

RFC 6238 — TOTP: Time-Based One-Time Password AlgorithmRFC 4648 — Base16, Base32 and Base64 data encodings
Advertisement
300 × 250
Was this tool any good?
INTERNAL SIGNAL ONLY · WE USE IT TO FIND TOOLS WORTH REBUILDING