PHPackages                             nsp-team/google-authenticator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. nsp-team/google-authenticator

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

nsp-team/google-authenticator
=============================

Google Authenticator

v0.0.1(4y ago)111Apache-2.0PHPPHP &gt;=7.3.0

Since Dec 1Pushed 4y agoCompare

[ Source](https://github.com/nsp-team/google-authenticator)[ Packagist](https://packagist.org/packages/nsp-team/google-authenticator)[ RSS](/packages/nsp-team-google-authenticator/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Summary
=======

[](#summary)

This is a php library ，Google Authenticator One-time Password Algorithm in PHP

>

1. 相对于验证码，安全很多；几乎是不会存在破解的方法
2. 验证码有时候无法识别，不方便操作
3. 一机一码，不会存在账号盗用的问题
4. 动态验证，每30秒生产一个验证码，安全更加保障

see:

Installation
============

[](#installation)

This library is installable via composer `composer require nsp-team/google-authenticator`

Usage
=====

[](#usage)

```
require_once "vendor/autoload.php";

use NspTeam\Authenticator\GoogleAuthenticator;

$ga = new GoogleAuthenticator();

$secret = $ga->createSecret();
echo "Secret is: ".$secret."\n\n";

$qrCodeUrl = $ga->getQRCodeGoogleUrl('Blog', $secret);
echo "Google Charts URL for the QR-Code: ".$qrCodeUrl."\n\n";

$oneCode = $ga->getCode($secret);
echo "Checking Code '$oneCode' and Secret '$secret':\n";

$checkResult = $ga->verifyCode($secret, $oneCode, 2);    // 2 = 2*30sec clock tolerance
if ($checkResult) {
    echo 'OK';
} else {
    echo 'FAILED';
}

```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1628d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b9755903f7a6e3183dc76df22ec6c1db85fc54724e85c6e4351efbfd563bc07a?d=identicon)[19951591761](/maintainers/19951591761)

---

Top Contributors

[![Maoxp](https://avatars.githubusercontent.com/u/37761489?v=4)](https://github.com/Maoxp "Maoxp (3 commits)")

---

Tags

totpgoogleauthenticatorrfc6238

### Embed Badge

![Health badge](/badges/nsp-team-google-authenticator/health.svg)

```
[![Health](https://phpackages.com/badges/nsp-team-google-authenticator/health.svg)](https://phpackages.com/packages/nsp-team-google-authenticator)
```

###  Alternatives

[spomky-labs/otphp

A PHP library for generating one time passwords according to RFC 4226 (HOTP Algorithm) and the RFC 6238 (TOTP Algorithm) and compatible with Google Authenticator

1.5k46.1M119](/packages/spomky-labs-otphp)[christian-riesen/otp

One Time Passwords, hotp and totp according to RFC4226 and RFC6238

885.1M6](/packages/christian-riesen-otp)[chillerlan/php-authenticator

A generator for counter- and time based 2-factor authentication codes (Google Authenticator). PHP 8.2+

58119.1k2](/packages/chillerlan-php-authenticator)[vectorface/googleauthenticator

Google Authenticator 2-factor authentication

19227.3k1](/packages/vectorface-googleauthenticator)[hiqdev/yii2-mfa

Multi-factor authentication for Yii2 projects

1015.1k1](/packages/hiqdev-yii2-mfa)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
