PHPackages                             lorddashme/php-two-factor-auth - 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. lorddashme/php-two-factor-auth

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

lorddashme/php-two-factor-auth
==============================

A PHP library for RFC 4226 and RFC 6238.

1.0.2(6y ago)3141MITPHPPHP &gt;=5.3 || &gt;=5.4 || &gt;=5.6 || &gt;=7.0 || &gt;=7.1 || &gt;=7.2CI failing

Since May 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/LordDashMe/php-two-factor-auth)[ Packagist](https://packagist.org/packages/lorddashme/php-two-factor-auth)[ RSS](/packages/lorddashme-php-two-factor-auth/feed)WikiDiscussions master Synced 1w ago

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

PHP Two Factor Auth
===================

[](#php-two-factor-auth)

A PHP library for RFC 4226 and RFC 6238.

[![Latest Stable Version](https://camo.githubusercontent.com/109de5994eb61ac3464365a8b68c6ae3c0b1be8672d71f622d88df9bd5f1ec96/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f7264646173686d652f7068702d74776f2d666163746f722d617574682e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lorddashme/php-two-factor-auth) [![Minimum PHP Version](https://camo.githubusercontent.com/86e7d829a466cacd5658a22073e27d49d39dac72cc18216ac4963ed5463c5bbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/) [![Coverage Status](https://camo.githubusercontent.com/d312fcee22624f563d8cc4c9d13ee1ee355d6c25666770f2c5b0bd58d27e0ae0/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f4c6f7264446173684d652f7068702d74776f2d666163746f722d617574682f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/LordDashMe/php-two-factor-auth?branch=master)

Requirement(s)
--------------

[](#requirements)

- PHP version from 5.6.\* up to latest.

Install
-------

[](#install)

- Recommended to install using Composer. Use the command below to install the package:

```
composer require lorddashme/php-two-factor-auth

```

Usage
-----

[](#usage)

### HOTP

[](#hotp)

- To generate HMAC-based One-Time Password algorithm:

```
