| 1 |
HOTP - PHP Based HMAC One Time Passwords |
| 2 |
======================================== |
| 3 |
|
| 4 |
**What is HOTP**: |
| 5 |
HOTP is a class that simplifies One Time Password systems for PHP Authentication. The HOTP/TOTP Algorithms have been around for a bit, so this is a straightforward class to meet the test vector requirements. |
| 6 |
|
| 7 |
**What works with HOTP/TOTP**: |
| 8 |
It's been tested to the test vectors, and I've verified the time-sync hashes against the following: |
| 9 |
|
| 10 |
* Android: Mobile-OTP |
| 11 |
* iPhone: OATH Token |
| 12 |
|
| 13 |
**Why would I use this**: |
| 14 |
Who wouldn't love a simple drop-in class for HMAC Based One Time Passwords? It's a great extra layer of security (creating two-factor auth) and it's pretty darn zippy. |
| 15 |
|
| 16 |
**Okay you sold me. Give me some docs**: |
| 17 |
|
| 18 |
* $result = HOTP::generateByCounter($key, $counter); // event based |
| 19 |
* $result = HOTP::generateByTime($key, $window); // time based within a "window" of time |
| 20 |
* $result = HOTP::generateByTimeWindow($key, $window, $min, $max); // same as generateByTime, but for $min windows before and $max windows after |
| 21 |
|
| 22 |
with $result, you can do all sorts of neat things... |
| 23 |
|
| 24 |
* $result->toString(); |
| 25 |
* $result->toHex(); |
| 26 |
* $result->doDec(); |
| 27 |
* $result->toHotp($length); // how many digits in your OTP? |