http://www.perlmonks.org?node_id=1014058

m2mcgui has asked for the wisdom of the Perl Monks concerning the following question:

I have a script which uses a RSA digital signature as one of the records in a report. We are transitioning from a UNIX environment to a LINUX environment. When the private key is read, it produces the following output:
PARI: *** incorrect type in a transcendental function. at /opt/sta +ndard_perl/perl5881/lib/5.8.8/x86_64-linux/Math/pari.pm line 994.

Here is the code that I am trying to execute:

$private_key = new Crypt::RSA::Key::Private; $pkey = $private_key->read(Filename => $private_file); $RSA_tmp = $RSA_object->sign(Message => $PI_string, Key => $pkey);

In tracing through the code using the debugger it was discovered in LINUX that the data being loaded for the HASH table was the following: This is producing the values:

TEST = $VAR1 = bless( { 'Version' => '1.91', 'Cipher' => 'Blowfish' }, 'Crypt::RSA::Key::Private' ); HASH{_dq } => 0000000000000003 HASH{_d } => 0000000000000003 HASH{_n } => 0000000000000003 HASH{_q } => 0000000000000003 HASH{_e } => 0000000000000003 HASH{_p } => 0000000000000003 HASH{_dp } => 0000000000000003

This should reveal a very long number not just 3 for every value. So there seems to be something within the read. At this point, I tried to create a new key and received the following error:

PARI: *** incorrect type in gfloor. at /opt/standard_perl/perl5881 +/lib/5.8.8/Crypt/primes.pm line 580.

This is the only code running for that error:

#!/opt/standard_perl/perl5881/bin/perl -w use Crypt::RSA; my $keychain = new Crypt::RSA::Key; my ($public, $private) = $keychain->generate ( Identity => "test", Size => 1024, Verbosity => 1) or die $keychain->errstr(); $private->write( Filename => 'spi4500eb.private'); $public->write( Filename => 'spi4500eb.public');

I tried adding password to the file as seen in some of the other responses within this web site, but that did not work either. We are using Perl 5.8.8.1. And here is the modules being utilized:

use Digest::MD5; use Crypt::RSA; use Crypt::RSA::Key::Private; use Crypt::RSA::Key::Public; use Crypt::RSA::SS::PKCS1v15;

My question is has anyone seen this before? And if so, what did you do to fix it? Any help is greatly appreciated. Thanks in advance.