NAME
OCRA - OATH Challenge-Response Algorithm
VERSION
Version 1.00
SYNOPSIS
use Authen::OATH::OCRA;
my $key = '7110eda4d09e062aa5e4a390b0a572ac0d2c0220';
my $question = 'This is the challenge';
my $ocrasuite = 'OCRA-1:HOTP-SHA1-6:QA32';
my $ocra = Authen::OATH::OCRA->new(
ocrasuite => $ocrasuite,
key => $key, # key must be hex encoded
question => $question
);
my $otp = $ocra->ocra();
Parameters may be set after object instantiation using accesor methods before the ocra() method is called
use Authen::OATH::OCRA;
my $ocra = Authen::OATH::OCRA->new();
$ocra->ocrasuite('OCRA-1:HOTP-SHA512-6:C-QA32-PSHA1-S20-T1M');
$ocra->key('7110eda4d09e062aa5e4a390b0a572ac0d2c0220');
$ocra->counter(77777777);
$ocra->question("I bet you can't");
$ocra->password('f7c3bc1d808e04732adf679965ccc34ca7ae3441');
$ocra->session_information('Some session info');
$ocra->timestamp(1234567890);
my $otp = $ocra->ocra();
Description
Implementation of the OATH Challenge-Response authentication algorithm as defined by OATH (http://www.openauthentication.org) in RFC 6287 (http://tools.ietf.org/html/rfc6287)
PARAMETERS
Minimum required parameters are: ocrasuite, key and question. Aditional parameters (counter, password, session_information or timestamp) may be required depending on the specified ocrasuite.
Accesor methods are provided for each parameter
ocrasuite
Text string that specifies the operation mode for OCRA.
key
Text string with the shared secret key known to both parties, must be in hexadecimal format
counter
An unsigned integer value, must be sinchronized between both parties
question
Text string with the challenge question
password
Text string with the hash (SHA-1 , SHA-256 and SHA-512 are supported) value of PIN/password that is known to both parties, must be in hexadecimal format
session_information
Text string that contains information about the current session, must be UTF-8 encoded
timestamp
An unsigned integer value representing the Unix Time on the specified granularity
SUBROUTINES/METHODS
ocra
Returns a text string with the One Time Password for the provided parameter
my $otp = $ocra->ocra();
ocra() passed all the test vectors contained in the RFC document.
AUTHOR
Pascual De Ruvo, <pderuvo at gmail.com>
BUGS
Please report any bugs or feature requests to bug-authen-oath-ocra at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Authen-OATH-OCRA. 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::OCRA
You can also look for information at:
OCRA: OATH Challenge-Response Algorithm RFC http://tools.ietf.org/html/rfc6287
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
Copyright 2012 Pascual De Ruvo.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.