Join our Newsletter — 33% off our NHI Course
Home› Glossary› Authentication, Authorisation & Trust› Time-Based One-Time Password Secret
Authentication, Authorisation & Trust

Time-Based One-Time Password Secret

← Back to Glossary
By NHI Mgmt Group Updated October 28, 2026 Domain: Authentication, Authorisation & Trust

A time-based one-time password secret is the shared seed used to generate short-lived verification codes in TOTP authentication. The secret is enrolled into an authenticator app or hardware token, and each code is derived from that seed plus the current time, so protecting the secret protects the second factor.

What the TOTP secret does

The TOTP secret is the shared seed behind the rotating code, so the security of the second factor depends on the confidentiality, integrity and lifecycle of that seed. If the seed is copied, the short-lived codes it generates can be reproduced anywhere.

This is why enrolment, export, backup and migration matter. A seed is not just setup data, it is authentication material that can outlive the device that first received it unless it is handled carefully.

For a practical overview of authenticator app enrolment, seed handling and related OTP weaknesses, see Authenticator Apps and OTP Guide.

Why exposure of the secret is so dangerous

A leaked TOTP secret undermines the “something you have” factor because the attacker no longer needs the user’s device to generate valid codes. That makes phishing, malware, backup theft and insecure synchronisation especially damaging when the seed is reused or stored in a recoverable form.

Threat actors also benefit from the fact that TOTP is often deployed as a fallback or step-up method. If they can obtain the seed after the account has been enrolled, they may be able to produce valid codes until the secret is reset or replaced.

Controls for secrets handling matter here too, because the seed is part of the broader secrets lifecycle. Guide to the Secret Sprawl Challenge explains how exposed secrets accumulate across systems, and that pattern applies directly when OTP seeds are exported, backed up or left in recoverable storage.

The same exposure pattern is why TOTP seeds should be treated with the same discipline as other authentication secrets. The difference is that compromise does not reveal a static password, it enables ongoing code generation until the secret is revoked.

How organisations should think about storage and recovery

Most TOTP problems are not caused by the algorithm itself, but by how the secret is enrolled, copied and recovered. A seed stored in plain text, synced without controls, or recovered through an insecure support process creates a second factor that is weaker than intended.

Organisations should decide where the seed may exist, who can recover it, and whether backup codes or migration flows create unnecessary duplication. For broader lifecycle thinking around shared secrets, rotation and recovery, the Secrets Management Guide is a useful companion reference.

Seed handling also intersects with broader identity governance when the TOTP factor protects a user, admin or service workflow. The important question is whether the secret can be re-issued cleanly if the device is lost, while preventing silent duplication that preserves attacker access.

What to verify after enrolment or suspected compromise

After TOTP enrolment, or after any suspicion that the seed was exposed, the priority is to confirm whether the secret exists anywhere else and whether the account has other authenticators enrolled. A recovered or duplicated seed can survive a device reset, so reviewing the full enrolment and recovery path matters as much as reviewing the current token.

If the seed may have been copied, the safer assumption is that every code generated from it is compromised until the secret is replaced and any backup path is revalidated. When TOTP is one factor among several, the surrounding session state, recovery codes and alternate authenticators also need review.

For implementation context on rotating or revoking authentication material, the MFA Guide and OWASP Non-Human Identity Top 10 both reinforce the core principle that a strong factor loses value once its shared secret is exposed.

Risk and Threat Considerations

A TOTP secret becomes a single point of failure when it is copied into backup systems, export files, screenshots or support workflows. The danger is not the code format itself, but the fact that possession of the seed lets an attacker mint valid codes without the original device.

Failure mechanism: Theft or duplication of the shared seed lets an attacker generate current and future TOTP values until the seed is revoked or re-enrolled.

Impact: Account takeover, bypass of the second factor, and persistence across password resets if the seed and alternate recovery paths are both compromised.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 addresses the attack and risk surface, while NIST SP 800-63, NIST SP 800-53 Rev 5, OWASP ASVS and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-63Digital Identity GuidelinesDefines authenticator assurance and OTP authenticator handling for TOTP seeds.
Recommendation — Use phishing-resistant authenticators and manage TOTP enrollment, recovery and re-binding carefully.
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageA TOTP seed is a shared secret whose exposure enables code generation.
NHI-07 — Long-Lived SecretsTOTP seeds can persist across device loss and remain usable until reissued.
Recommendation — Store TOTP seeds securely and prevent them from leaking into logs, exports or backups. Rotate or re-enrol exposed TOTP seeds and reduce unnecessary seed lifetime.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementCovers lifecycle management of authenticators and associated secrets.
IA-2 — Identification and Authentication (Organizational Users)TOTP seeds support user authentication as an authenticator component.
Recommendation — Manage TOTP seeds through secure issuance, storage, rotation and revocation. Bind TOTP enrollment to verified users and protect the enrollment process from abuse.
OWASP ASVSV6 — AuthenticationCovers authenticator security, enrollment and MFA design for OTP-based factors.
Recommendation — Verify that TOTP enrollment, verification and recovery flows resist secret theft and replay.
CIS Controls v8CIS-6 — Access Control ManagementSupports managing authentication material and revocation paths for access.
Recommendation — Restrict access to TOTP seeds and revoke them promptly after suspected compromise.

Practitioner Guidance

Why practitioners should care: Treat the TOTP secret as protected authentication material, not as a harmless setup artifact. The operational question is whether your enrolment, backup and recovery flows allow the seed to be copied more widely than the account owner can control.

What to watch for: QR-code export, shared device enrolment, untracked backups and support processes that can reissue or reveal the secret are the usual weak points. If those paths exist, the factor is easier to clone than many teams assume.

Practitioner takeaway: A TOTP deployment is only as strong as the secrecy of the seed, so the real control objective is to minimise where that seed can exist and who can recover it.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 28, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org