# PHPGangsta/GoogleAuthenticator

PHP class to generate and verify Google Authenticator 2-factor authentication

Repository: https://github.com/PHPGangsta/GoogleAuthenticator
Canonical: https://ross.abutalabs.com/products/googleauthenticator
Homepage: http://phpgangsta.de/4376
Language: PHP
License: BSD-2-Clause
License Family: permissive
Last push: 2024-04-30T12:57:04+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 5288, "days_push": 855, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2325, forks 718 (observed 2026-08-28T04:06:37.375483+00:00)

## What it is
A PHP library implementing TOTP (RFC 6238) for Google Authenticator two-factor authentication. It generates secrets and codes, verifies codes with clock tolerance, and produces QR code URLs for provisioning secrets.

## Use cases
- add two-factor authentication to a PHP login system
- generate TOTP secrets for users to scan with Google Authenticator
- verify 6-digit one-time codes server-side
- show a QR code so users can enroll their authenticator app
- implement RFC 6238 time-based OTP in PHP

## When to choose
- you need a small, dependency-light PHP class for TOTP 2FA
- you want a battle-tested library with a simple API for secret generation and code verification

## When to avoid
- you need built-in replay protection or brute-force rate limiting (you must implement these yourself)
- you need HOTP counter-based OTP or advanced 2FA features like WebAuthn
- you are not working in PHP

## Facets
- artifact type: library
- maturity: maintenance
- function: auth, security, cryptography
- domain: security, web-development, backend
- platform: php
- tags: totp, two-factor-authentication, google-authenticator, rfc6238, otp, qr-code

## Member repositories
- PHPGangsta/GoogleAuthenticator (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:37.375483+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-30T02:38:22.975473+00:00, confidence not recorded.
  - readme: https://github.com/PHPGangsta/GoogleAuthenticator (fetched 2026-08-28T04:06:37.375483+00:00, sha c3d238267085)
- Data as of 2026-08-30T08:39:29.467469+00:00.
