Alt-Crypt-RSA-BigInt

 view release on metacpan or  search on metacpan

Changes.old  view on Meta::CPAN

163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
  * Fixed a bug in ::ES::PKCS1v15 caused by inclusion of null characters
    in the padding string. Null chars are used as delimiters in PKCS #1
    v1.5 encoding. Thanks to Ganèche <gramanoudjame@promonetic.com>
    for reporting this bug.
 
 
1.36                                                        April 10, 2001
 
  * Modified Crypt::RSA::encrypt() to return an error when the keysize is
    too small for use with the selected scheme.
 
  * Modified Crypt::RSA ::ES::* and ::SS::* to work with keysizes
    that are not multiples of 8.
 
  * Wrote ::DataFormat::octet_len() to computes the octet length of
    an integer.
 
  * Wrote exportable ::Debug::debuglevel(). Use debuglevel(1) to turn on
    debugging.

lib/Crypt/RSA/Key.pm  view on Meta::CPAN

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
    $params{Size} % 2;
 
my $size = int($params{Size}/2); 
my $verbosity = $params{Verbosity} || 0;
 
# Switch from Maurer prime to nbit prime, then add some more primality
# testing.  This is faster and gives us a wider set of possible primes.
 
# We really ought to consider the distribution.  See:
# for comments on p/q selection.
 
while (1) {
  my $p = random_nbit_prime($size);
  my $q = random_nbit_prime($size);
  $p = Math::BigInt->new("$p") unless ref($p) eq 'Math::BigInt';
  $q = Math::BigInt->new("$q") unless ref($q) eq 'Math::BigInt';
 
  # For unbiased rejection sampling, generate both p/q if size too small.
  next unless bitsize($p * $q) == $params{Size};



( run in 0.310 second using v1.01-cache-2.11-cpan-87723dcf8b7 )