Implementation of the HOTP and TOTP One Time Password algorithms
as defined by OATH (http://www.openauthentication.org)
All necessary parameters are set by default, though these can be
overridden. Both totp() and htop() have passed all of the test
vectors defined in the RFC documents for TOTP and HOTP.
totp() and hotp() both default to returning 6 digits and using SHA1.
As such, both can be called by passing only the secret key and a
valid OTP will be returned.
my $oath = Authen::OATH->new();
my $totp = $oath->totp( "MySecretPassword" );
my $hotp = $oath->hotp( "MyOtherSecretPassword" );
Parameters may be overridden when creating the new object:
my $oath = Authen::OATH->new( digits => 8 );
The three parameters are digits, digest, and timestep.
Timestep only applies to the totp() function.
While strictly speaking this is outside the specifications of
HOTP and TOTP, you can specify digests other than SHA1. For example:
my $oath = Authen::OATH->new( "digits" => 10,
"digest" => "Digest::MD6"