qmetrics.net

Otp.NET

C# TOTP and HOTP library for two-factor codes

Otp.NET screenshot

Otp.NET implements RFC 6238 TOTP and RFC 4226 HOTP in C# for generating and verifying one-time passwords used in two-factor authentication.

Overview

Otp.NET gives .NET applications a straightforward way to compute and validate time-based and counter-based one-time codes from a shared secret. The timed variant rolls codes over configurable step windows and supports SHA-1, SHA-256, and SHA-512 hashing with adjustable digit length.

Developers create Totp or Hotp instances, call compute methods with UTC timestamps or counters, and verify user-supplied codes. Verification can honor RFC-recommended clock skew via a verification window, report which time step matched, and apply optional time-correction offsets when client clocks drift from authoritative time.

Additional helpers generate OTP URI strings in the standard key URI format and provide Base32 encoding utilities compatible with authenticator apps. The package ships on NuGet for .NET Standard, modern .NET, and .NET Framework targets and can run server-side or inside mobile apps built with Mono.

Consumers remain responsible for ensuring each code is accepted only once, since the library itself does not persist usage state.

Key features

  • RFC 6238 TOTP implementation
  • RFC 4226 HOTP implementation
  • Configurable hash and digit size
  • VerifyTotp with skew windows
  • TimeCorrection for clock drift
  • OTP URI key format generator
  • Base32 encoding helper
  • NuGet distribution for .NET

Use cases

  • Server-side 2FA verification
  • Embedding OTP in mobile apps
  • Building custom authenticator flows
  • Generating provisioning URIs

Tags

Similar software

Keycloak

Identity and access management for applications and services

Keycloak adds authentication and single sign-on to applications so they do not store or verify users themselves. It supports standard protocols and central admin tools.

★ 38.1k⟳ todayApache-2.0
Open Source Alternative to:Amazon CognitoAuth0+7

JumpServer

Open-source bastion host for privileged access

JumpServer is a privileged access management platform that unifies secure access to SSH, RDP, Kubernetes, databases, and web assets.

★ 32.1k⟳ yesterdayGPL-3.0
Open Source Alternative to:BeyondTrust

Better Auth

Composable TypeScript authentication and authorization framework

Better Auth is a framework-agnostic authentication and authorization framework for TypeScript. You configure it in code and extend it with plugins for flows like social login, organizations, and enterprise SSO.

★ 30.9k⟳ todayMIT
Open Source Alternative to:Stytch

Infisical

Open-source security infrastructure for secrets, certs, and access

Infisical is a security infrastructure platform where teams manage application secrets, certificates, privileged access, and AI agent credentials in one place.

★ 30.8k⟳ todayMIT · open core
Secrets ManagementSelf-hostable
Open Source Alternative to:Keeper

Authelia

Self-hosted SSO portal with multi-factor authentication

Authentication and authorization server that sits in front of reverse proxies. Provides a web portal for login, OpenID Connect, and granular access rules with several second-factor methods.

★ 29.8k⟳ todayApache-2.0
Open Source Alternative to:Amazon CognitoAuth0+2

NextAuth

Web authentication libraries for JavaScript frameworks

Auth.js (NextAuth) adds sign-in, sessions, and OAuth to modern JavaScript apps. Packages target Next.js, SvelteKit, Express, Qwik, and other runtimes.

★ 28.4k⟳ 4 months agoISC