PHPackages                             ideo/otpauth - 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. [Security](/categories/security)
4. /
5. ideo/otpauth

ActiveLibrary[Security](/categories/security)

ideo/otpauth
============

Provides necessary processing for TOTP.

0.1(8y ago)016Apache-2.0PHPPHP &gt;=5.6.4

Since Nov 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/aideo/otpauth)[ Packagist](https://packagist.org/packages/ideo/otpauth)[ RSS](/packages/ideo-otpauth/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

ideo/otpauth
============

[](#ideootpauth)

[![Build Status](https://camo.githubusercontent.com/9a46dc245e128b65b784f521eb094b108b3f802b2b61bfabed999e7983f2ad18/68747470733a2f2f7472617669732d63692e6f72672f616964656f2f6f7470617574682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/aideo/otpauth)

Provides necessary processing for TOTP.

For pin generation and authentication, it is based on the implementation of google-authenticator.

-

Usage
-----

[](#usage)

Generation of QR code for TOTP compatible applications.

```
$keyGenerator = new KeyGenerator();
$qrCodeGenerator = new QrCodeGenerator();

// Generate keys randomly, save this key in association with the target account.
$keyBytes = $keyGenerator->generateRandom(10);

$qrDataUri = $qrCodeGenerator->getQrCodeDataUri($keyBytes, 'sample@foo.bar', 'Sample');

```

Authentication using pin.

```
// It reads the key of the target account and compares it with the input pin.
$passcodeGenerator = new PasscodeGenerator(new HMacSigner($keyBytes));
$counter = new TotpCounter();
$time = time();

$valid = $passcodeGenerator->verifyTimeoutCode($pin, $counter->getValueAtTime($time));

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

3086d ago

### Community

Maintainers

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

---

Top Contributors

[![cosmicvelocity](https://avatars.githubusercontent.com/u/1166307?v=4)](https://github.com/cosmicvelocity "cosmicvelocity (11 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ideo-otpauth/health.svg)

```
[![Health](https://phpackages.com/badges/ideo-otpauth/health.svg)](https://phpackages.com/packages/ideo-otpauth)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M212](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M112](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[enlightn/security-checker

A PHP dependency vulnerabilities scanner based on the Security Advisories Database.

33732.2M110](/packages/enlightn-security-checker)

PHPackages © 2026

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