# Spomky-Labs/otphp

:closed_lock_with_key: A PHP library for generating one time passwords according to RFC 4226 (HOTP) and the RFC 6238 (TOTP)

Repository: https://github.com/Spomky-Labs/otphp
Canonical: https://ross.abutalabs.com/products/otphp
Language: PHP
License: MIT
License Family: permissive
Topics: otp, totp, hotp, php, rfc-4226, rfc-6238, rfc4226, rfc6238
Last push: 2026-08-01T09:04:11+00:00

## Health v2 (maintenance only)
Score: 93/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 87, longevity 100
- inputs: {"age_days": 4700, "days_push": 32, "days_rel": 88, "gap_med": 11.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1488, forks 159 (observed 2026-08-28T04:04:52.096115+00:00)

## What it is
A PHP library for generating one-time passwords according to RFC 4226 (HOTP) and RFC 6238 (TOTP). It is compatible with Google Authenticator, FreeOTP, and similar apps.

## Use cases
- add two-factor authentication to a PHP application
- generate TOTP codes compatible with Google Authenticator
- implement HOTP one-time password generation
- verify OTP codes during user login
- provision 2FA secrets for authenticator apps

## When to choose
- you need standards-compliant HOTP/TOTP in a PHP project
- you want compatibility with common authenticator apps
- you need a lightweight MIT-licensed OTP library

## When to avoid
- you need full multi-factor authentication flows with WebAuthn or passkeys
- your project is not in PHP

## Facets
- artifact type: library
- maturity: stable
- function: auth, cryptography, security
- domain: security, developer-tools, web-development
- platform: php
- tags: otp, totp, hotp, two-factor-authentication, rfc-4226, rfc-6238, google-authenticator

## Member repositories
- Spomky-Labs/otphp (main) score 93

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:52.096115+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:33:43.247897+00:00, confidence not recorded.
  - readme: https://github.com/Spomky-Labs/otphp (fetched 2026-08-28T04:04:52.096115+00:00, sha 74137ffb393e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
