2017 © Pedro Peláez
 

library otpauth

Provides necessary processing for TOTP.

image

ideo/otpauth

Provides necessary processing for TOTP.

  • Friday, February 9, 2018
  • by cosmicvelocity
  • Repository
  • 1 Watchers
  • 0 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ideo/otpauth

Build Status, (*1)

Provides necessary processing for TOTP., (*2)

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

Usage

Generation of QR code for TOTP compatible applications., (*4)

$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., (*5)

// 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));

The Versions

09/02 2018

dev-master

9999999-dev

Provides necessary processing for TOTP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Kouichi Machida

26/11 2017

0.1

0.1.0.0

Provides necessary processing for TOTP.

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Kouichi Machida