VERSION

Version 1.0.0

SYNOPSIS

Implementation of the \s-1HOTP\s0 and \s-1TOTP\s0 One Time Password algorithms as defined by \s-1OATH\s0 (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 \s-1RFC\s0 documents for \s-1TOTP\s0 and \s-1HOTP\s0.

totp() and hotp() both default to returning 6 digits and using \s-1SHA1\s0. As such, both can be called by passing only the secret key and a valid \s-1OTP\s0 will be returned.

    use Authen::OATH;

    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 \*(L"digits\*(R", \*(L"digest\*(R", and \*(L"timestep.\*(R" Timestep only applies to the totp() function.

While strictly speaking this is outside the specifications of \s-1HOTP\s0 and \s-1TOTP\s0, you can specify digests other than \s-1SHA1\s0. For example:

my $oath = Authen::OATH->new( "digits" => 10, "digest" => "Digest::MD6" );

SUBROUTINES/METHODS

totp

my $otp = $oath->totp( $secret [, $manual_time ] );

Manual time is an optional parameter. If it is not passed, the current time is used. This is useful for testing purposes.

hotp

my $opt = $oath->hotp( $secret, $counter );

Both parameters are required.

_process

This is an internal routine and is never called directly.

AUTHOR

Kurt Kincaid, \*(C`<kurt.kincaid at gmail.com>\*(C'

BUGS

Please report any bugs or feature requests to \*(C`bug-authen-totp at rt.cpan.org\*(C', or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Authen-OATH <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Authen-OATH>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Authen::OATH

You can also look for information at:

  • \s-1RT:\s0 \s-1CPAN\s0's request tracker http://rt.cpan.org/NoAuth/Bugs.html?Dist=Authen-OATH <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Authen-OATH>

  • AnnoCPAN: Annotated \s-1CPAN\s0 documentation http://annocpan.org/dist/Authen-OATH <http://annocpan.org/dist/Authen-OATH>

  • \s-1CPAN\s0 Ratings http://cpanratings.perl.org/d/Authen-OATH <http://cpanratings.perl.org/d/Authen-OATH>

  • Search \s-1CPAN\s0 http://search.cpan.org/dist/Authen-OATH/ <http://search.cpan.org/dist/Authen-OATH/>

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

Copyright 2010 Kurt Kincaid.

This program is free software; you can redistribute it and/or modify it under the terms of either: the \s-1GNU\s0 General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.