PHPackages                             marc1706/otp-authenticate - 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. marc1706/otp-authenticate

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

marc1706/otp-authenticate
=========================

Provides a simple and up-to-date library for two-factor authentication using OTP hashes and Google Authenticator or a similar app.

1.0.1(11y ago)2599[1 PRs](https://github.com/marc1706/otp-authenticate/pulls)1MITPHPPHP &gt;=5.3.0CI failing

Since Jan 20Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/marc1706/otp-authenticate)[ Packagist](https://packagist.org/packages/marc1706/otp-authenticate)[ Docs](https://www.m-a-styles.de)[ RSS](/packages/marc1706-otp-authenticate/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (2)Versions (4)Used By (1)

### About

[](#about)

This library implements OTP authentication into PHP. It allows users to generate TOTP and HOTP codes for two-factor authentication. Generated codes can be created using sha1, sha256, or sha512 hashes. Whilst Google Authenticator will only support the first hash type, the latter two are properly supported by apps like FreeOTP.

Codes are compared using a constant time comparison method and secrets are generated using openssl\_random\_pseudo\_bytes().

### Requirements

[](#requirements)

PHP 7.2.0 or newer is required for this library to work.

### Automated Testing

[](#automated-testing)

The library is being tested using unit tests to prevent possible issues.

[![Tests](https://github.com/marc1706/otp-authenticate/actions/workflows/tests.yml/badge.svg)](https://github.com/marc1706/otp-authenticate/actions/workflows/tests.yml)[![Code Coverage](https://camo.githubusercontent.com/13375f0f47035f0a4ef3ac23edd322ed0d6a1b89263641bc358cdf44360c62ea/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d617263313730362f6f74702d61757468656e7469636174652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/marc1706/otp-authenticate/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7b47ddc050900165468a3a15750a67c4c31ec812f3f32dc30a6e945d51766633/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d617263313730362f6f74702d61757468656e7469636174652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/marc1706/otp-authenticate/?branch=master)

### License

[](#license)

[The MIT License (MIT)](http://opensource.org/licenses/MIT)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance49

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Every ~11 days

Total

2

Last Release

4170d ago

### Community

Maintainers

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

---

Top Contributors

[![marc1706](https://avatars.githubusercontent.com/u/394418?v=4)](https://github.com/marc1706 "marc1706 (51 commits)")

---

Tags

googleotphotptotpAuthenticationtwo-factorauthenticator

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/marc1706-otp-authenticate/health.svg)

```
[![Health](https://phpackages.com/badges/marc1706-otp-authenticate/health.svg)](https://phpackages.com/packages/marc1706-otp-authenticate)
```

###  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.5k50.3M168](/packages/spomky-labs-otphp)[chillerlan/php-authenticator

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

58133.8k3](/packages/chillerlan-php-authenticator)[lfkeitel/phptotp

TOTP/HOTP library for PHP

85476.4k2](/packages/lfkeitel-phptotp)[remotemerge/totp-php

Lightweight, fast, and secure TOTP (2FA) authentication library for PHP — battle tested, dependency free, and ready for enterprise integration.

2118.5k](/packages/remotemerge-totp-php)[kelunik/two-factor

Two factor authentication.

371.9k2](/packages/kelunik-two-factor)

PHPackages © 2026

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