PHPackages                             ilbee/totp - 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. ilbee/totp

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

ilbee/totp
==========

Time-based One-Time Password (TOTP) implementation in PHP

2.1.0(2y ago)113MITPHPPHP 7.4 || ^8.1

Since Apr 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ilbee/totp)[ Packagist](https://packagist.org/packages/ilbee/totp)[ Docs](https://github.com/ilbee/totp)[ RSS](/packages/ilbee-totp/feed)WikiDiscussions 2.0 Synced 1mo ago

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

ilbee/totp
==========

[](#ilbeetotp)

[![GitHub last commit](https://camo.githubusercontent.com/f767b29e7541bc98b1c8e83a690dbe81d3297a248282cf29548d45918e573a43/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f696c6265652f746f7470)](https://camo.githubusercontent.com/f767b29e7541bc98b1c8e83a690dbe81d3297a248282cf29548d45918e573a43/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f696c6265652f746f7470)[![GitHub Sponsors](https://camo.githubusercontent.com/d5c94387c29cd22b86503f2aa91b6a2d9418581175ba23d92aee53d757217714/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73706f6e736f72732f696c626565)](https://camo.githubusercontent.com/d5c94387c29cd22b86503f2aa91b6a2d9418581175ba23d92aee53d757217714/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73706f6e736f72732f696c626565)[![GitHub Issues or Pull Requests](https://camo.githubusercontent.com/49010fca0b22649b560b2916cdc7daaf2774f2f09981e8bbff01bba2e651073e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f696c6265652f746f7470)](https://camo.githubusercontent.com/49010fca0b22649b560b2916cdc7daaf2774f2f09981e8bbff01bba2e651073e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f696c6265652f746f7470)[![Packagist License](https://camo.githubusercontent.com/981c5cb4d3c873ed0b457f9f586af490e2a4796ec5dd7012960f85a306c2e294/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f696c6265652f746f7470)](https://camo.githubusercontent.com/981c5cb4d3c873ed0b457f9f586af490e2a4796ec5dd7012960f85a306c2e294/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f696c6265652f746f7470)[![Packagist Version](https://camo.githubusercontent.com/646a6746b64fc4647fca62ac0748a02093e3d62b940b55ef400c9e7c3fb5489b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696c6265652f746f7470)](https://camo.githubusercontent.com/646a6746b64fc4647fca62ac0748a02093e3d62b940b55ef400c9e7c3fb5489b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696c6265652f746f7470)[![Packagist Downloads](https://camo.githubusercontent.com/1d26204d3bbb66dd02a0516836796282546e828d842be5397abfe19ed2ba9dfb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696c6265652f746f7470)](https://camo.githubusercontent.com/1d26204d3bbb66dd02a0516836796282546e828d842be5397abfe19ed2ba9dfb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696c6265652f746f7470)[![Packagist Stars](https://camo.githubusercontent.com/b359e67172cd9573bd9fd99c32eff6991d5fab65f6542b06ae2c35c1d8f609bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f696c6265652f746f7470)](https://camo.githubusercontent.com/b359e67172cd9573bd9fd99c32eff6991d5fab65f6542b06ae2c35c1d8f609bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f696c6265652f746f7470)

This project is a PHP implementation of the TOTP (Time-Based One-Time Password) algorithm. This library is designed to be used with the Symfony framework.

Installation
------------

[](#installation)

You can install this library via Composer:

```
composer require ilbee/totp
```

Usage
-----

[](#usage)

- [Prerequisites](doc/USAGE.md#prerequisites)
- [Generate a secret key](doc/USAGE.md#generate_a_secret_key)
- [Validate a TOTP](doc/USAGE.md#validate_a_totp)
- [Generate a QR code](doc/USAGE.md#generate_a_qr_code)

Configuration
-------------

[](#configuration)

You can configure TOTP by passing additional options when creating the instance:

```
