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 );
From https://www.grc.com/ppp.htm
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.
new
Create a new Create::PerfectPaperPasswords instance. Options may be passed:
Create::PerfectPaperPasswords
my $ppp = Crypt::PerfectPaperPasswords->new( alphabet => '0123456789abcdef', codelen => 2 );
The following options are supported:
alphabet
The alphabet to use for encoding. Defaults to Steve Gibson's:
23456789!@#%+=:?abcdefghijkmnopq rstuvwxyzABCDEFGHJKLMNPRSTUVWXYZ
The size of the alphabet need not be a power of two.
codelen
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;
sequence_from_key
Generate a sequence key from a passphrase.
my $seq_key = $ppp->sequence_from_key( 'Fromage' );
random_sequence
Generate a random sequence key.
my $seq_key = $ppp->random_sequence;
Relies on the output of random_data for its entropy.
random_data
Returns some random data. This is the entropy source for random_sequence. This implementation returns a string that is the concatenation of
The real time (using the microsecond clock)
The next seed value
Address of $self
$self
Address of a newly allocated scalar
Process ID
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.
passcodes
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.
Crypt::Rijndael
Digest::SHA256
Scalar::Util
Time::HiRes
Math::BigInt (optional)
None reported.
No bugs have been reported.
Please report any bugs or feature requests to bug-crypt-perfectpaperpasswords@rt.cpan.org, or through the web interface at http://rt.cpan.org.
bug-crypt-perfectpaperpasswords@rt.cpan.org
Andy Armstrong <andy@hexten.net>
<andy@hexten.net>
Original Perfect Paper Passwords implementation by Steve Gibson. More details here:
http://www.grc.com/ppp.htm
Copyright (c) 2007, Andy Armstrong <andy@hexten.net>.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
To install Crypt::PerfectPaperPasswords, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Crypt::PerfectPaperPasswords
CPAN shell
perl -MCPAN -e shell install Crypt::PerfectPaperPasswords
For more information on module installation, please visit the detailed CPAN module installation guide.