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 2015-01-31 16:43 UTC

This package is auto-updated.

Last update: 2024-04-05 18:24:10 UTC


README

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

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

Automated Testing

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

Tests Code Coverage Scrutinizer Code Quality

License

The MIT License (MIT)