# kspearrin/Otp.NET

A .NET implementation of TOTP and HOTP for things like two-factor authentication codes.

Repository: https://github.com/kspearrin/Otp.NET
Canonical: https://ross.abutalabs.com/products/otpnet
Homepage: https://www.nuget.org/packages/Otp.NET
Language: C#
License: MIT
License Family: permissive
Topics: otp, totp, two-factor-authentication, 2fa, csharp, dotnet, hotp
Last push: 2025-12-01T19:30:03+00:00

## Health v2 (maintenance only)
Score: 54/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 55, release rhythm 27, longevity 100
- inputs: {"age_days": 3519, "days_push": 275, "days_rel": 275, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1319, forks 181 (observed 2026-08-28T04:04:21.274768+00:00)

## What it is
Otp.NET is a C# library implementing TOTP (RFC 6238) and HOTP (RFC 4226) one-time password algorithms, available on NuGet. It supports configurable hash modes, time steps, code lengths, OTP URIs, and Base32 encoding for two-factor authentication flows.

## Use cases
- generate and validate TOTP 2FA codes in a .NET server
- implement two-factor authentication in a C# application
- verify Google Authenticator codes server-side
- generate HOTP one-time passwords in .NET
- embed TOTP code calculation in a mobile app via Mono
- parse and build otpauth:// URIs in C#

## When to choose
- you need standards-compliant TOTP/HOTP in a .NET or .NET Standard project
- you want a small, focused, MIT-licensed library with configurable hash algorithms and step windows
- you need to validate 2FA codes from authenticator apps server-side

## When to avoid
- you need full multi-factor authentication with WebAuthn or push-based flows
- your stack is not .NET
- you need a ready-made 2FA UI or user management rather than just OTP calculation

## Facets
- artifact type: library
- maturity: stable
- function: auth, cryptography, sdk
- domain: security, developer-tools, backend
- platform: dotnet, cross-platform
- tags: totp, hotp, two-factor-authentication, 2fa, otp, base32, rfc6238, rfc4226

## Member repositories
- kspearrin/Otp.NET (main) score 54

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:21.274768+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:47:54.602362+00:00, confidence not recorded.
  - readme: https://github.com/kspearrin/Otp.NET (fetched 2026-08-28T04:04:21.274768+00:00, sha 28933f255d60)
  - homepage: https://www.nuget.org/packages/Otp.NET (fetched 2026-08-29T12:06:28.664926+00:00, sha 13a3f75bf103)
  - site_page: https://www.nuget.org/policies/About (fetched 2026-08-29T12:06:28.674572+00:00, sha a113b8a074c9)
- Data as of 2026-08-30T08:39:29.467469+00:00.
