VOMS::Lite::RSAKey - Perl extension for RSA Key Generation
use VOMS::Lite::RSAKey; %RSAKey = %{ VOMS::Lite::RSAKey::Create(%inputref) };
Generates an RSA key using the MillerRabin Prime search for probable primes. %inputref may have the following set Bits => bits e.g. 512 RandomFile /path/to/random e.g. /dev/random or /dev/urandom, or a reference to a function where: $_[0] contains the number of bytes of random Returns a string of random bytes. Verbose => 'y' returns A reference to a hash: either: Errors ( a regernec to an array of errors ) - or - Modulus, PublicExponent, PrivateExponent, Prime1, Prime2, Exponent1, Exponent2, Phi and Bits = the number of bits for generated key
Math::BigInt Random ( \%inputref ); where %inputref consists of: Bits => number of bits of random number to generate e.g. 256 - or - Upper => upper limit of random number to generate (scalar or Math::BigInt) Lower => lower limit (default = 0) Parity => "Odd" | "Even" returns Math::BigInt object;
Finder( \%inputref ) finds the next 'probable' prime number after a given number. where %inputref consists of: Start => (number scalar or Math::BigInt to start searching at) Tests => a string consisting of DFSM (tests are performed in the order specified) D is VOMS::Lite::RSAKey::DivisionTest F is VOMS::Lite::RSAKey::FermatTest S is VOMS::Lite::RSAKey::SolovayStrassenTest M is VOMS::Lite::RSAKey::MillerRabinTest Default is 'M'. %inputref is passed through as an input to the above tests. Returns reference to hash which includes either Errors a reference to an array of errors - or - Candidate => Math::BigInt prime candidate
DivisionTest( \%inputref ) tests the candidate for primality by division by known small primes (upto the first 10000). This is a slow implementation. %inputref consist of Candidate => scalar or Math::BigInt to test D = the number of prime divisors to test; the default is the maximum 10000 returns 0 if Candidate has small prime divisor otherwise returns 1
FermatTest( \%inputref ) tests the candidate for probable primality This is not a good test %inputref consist of Candidate => scalar or Math::BigInt to test F = the number of random divisors to test; the default is 10 returns 0 if composite returns 1 if probably prime
SolovayStrassenTest( \%inputref ) tests the candidate for probable primality This is a slow test and not as good as the MillerRabinTest %inputref consist of Candidate => scalar or Math::BigInt to test S = the number of random divisors to test; the default is 10 returns 0 if composite returns 1 if probably prime
Used by SolovayStrassenTest
MillerRabinTest( \%inputref ) tests the candidate for probable primality %inputref consist of Candidate => scalar or Math::BigInt to test M = the number of random divisors to test; the default is calculated based upon table Handbook of Applied Cryptography table 4.4 returns 0 if composite returns 1 if probably prime
None by default;
http://www.rcs.manchester.ac.uk/research/sarongs
This module was originally designed for the SARoNGS project at The University of Manchester for the NGS. http://www.rcs.manchester.ac.uk/research/sarongs http://www.ngs.ac.uk
Handbook of Applied Cryptography, CRC Press, ISBN: 0-8493-8523-7, October 1996.
Mike Jones <mike.jones@manchester.ac.uk>
Copyright (C) 2006 2010 by Mike Jones
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.
To install VOMS::Lite, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VOMS::Lite
CPAN shell
perl -MCPAN -e shell install VOMS::Lite
For more information on module installation, please visit the detailed CPAN module installation guide.