Crypt::PerfectPaperPasswords - Steve Gibson's Perfect Paper Passwords
This document describes Crypt::PerfectPaperPasswords version 0.06
use Crypt::PerfectPaperPasswords; my $pass_phrase = 'Fromage'; my $ppp = Crypt::PerfectPaperPasswords->new; my $sequence_key = $ppp->sequence_from_key( $pass_phrase ); my $first = 1; my $count = 100; my @passcodes = $ppp->passcodes( $first, $count, $sequence_key );
GRC's "Perfect Paper Passwords" (PPP) system is a straightforward, simple and secure implementation of a paper-based One Time Password (OTP) system. When used in conjunction with an account name & password, the individual "passcodes" contained on PPP's "passcards" serve as the second factor ("something you have") of a secure multi- factor authentication system.
This is a Perl implementation of the PPP passcode generator.
Create a new
Create::PerfectPaperPasswords instance. Options may be passed:
my $ppp = Crypt::PerfectPaperPasswords->new( alphabet => '0123456789abcdef', codelen => 2 );
The following options are supported:
The alphabet to use for encoding. Defaults to Steve Gibson's:
The size of the alphabet need not be a power of two.
The number of raw bytes in each passcode. You must have Math::BigInt installed to handle values greater than 4.
Get the alphabet used by this object.
my $alphabet = $ppp->alphabet;
Get the code length for this object.
my $codelen = $ppp->codelen;
Generate a sequence key from a passphrase.
my $seq_key = $ppp->sequence_from_key( 'Fromage' );
Generate a random sequence key.
my $seq_key = $ppp->random_sequence;
Relies on the output of
random_data for its entropy.
Returns some random data. This is the entropy source for
random_sequence. This implementation returns a string that is the concatenation of
The seed value is the microsecond time when this object was created and is incremented by one each time it's used.
For a lot of uses this is probably an adequate entropy source - but I'm not a cryptographer. If you'd like better entropy consider subclassing and provding a
random_data that reads from /dev/urandom.
Get an array of passcodes.
my @passcodes = $ppp->passcodes(1, 70, $seq_key);
The first two arguments are the starting position (1 .. n) and the number of passcodes to generate.
Returns an array of strings containing the generated passcodes.
Crypt::PerfectPaperPasswords requires no configuration files or environment variables.
No bugs have been reported.
Please report any bugs or feature requests to
email@example.com, or through the web interface at http://rt.cpan.org.
Original Perfect Paper Passwords implementation by Steve Gibson. More details here:
Copyright (c) 2007, Andy Armstrong
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.