Skip to content

dimamedia/PHP-Simple-TOTP-and-PubKey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

class.tfa.php

Simple php class for generating public key and one-time password (TOTP) for two factor authentication

How to?

require("class.tfa.php");
$tfa = new tfa();

Get public key:

$pubkey = $tfa->getPubKey();

print $pubkey; // Example: RADV RKNM KOV3 Q22A

Store public key on the server with the user account and use it in TOTP generators like Google Authenticator or Pebble's QuickAuth.

Generate TOTP - time-based one-time password:

$pubkey = 'RADV RKNM KOV3 Q22A'; // Saved or given public key

$otp = $tfa->getOtp($pubkey);

print $otp; // Example: 194074

Use it to compare with TOTP generated on the other device.

About

Simple php class for generating public key and time based one-time password (TOTP) for two factor authentication

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages