Crypt::TripleDES doesn't work with perl 5.8 (Linux)

J

Jonas

I have the following perl program witch i use to encrypt a
password file with.
In perl 5.6 this program works like a charm but when trying it on
the RED HAT EL 3 platform (taroon) is doesnt decrypt the encrypted string right.

Program
use Crypt::TripleDES;

sub generate()
{
print "Filename:";
$filename=<STDIN>;
print "Username:";
$username=<STDIN>;
$passphrase="dbatools";
open(FILE,">$filename")|| die("Error writing to file");
$des = new Crypt::TripleDES;
print FILE $cyphertext = $des->encrypt3 ( $username, $passphrase );
close FILE;
print "\n File generated";
}


sub decrypt()
{
print "Filename:";
$filename=<STDIN>;
$passphrase="dbatools";
open(FILE,"$filename")|| die("File not found");
$cypher=<FILE>;
close FILE;
$des = new Crypt::TripleDES;
print $des->decrypt3 ( $cypher, $passphrase );
}


if ( ! @ARGV )
{
print "Usage:: generate";
}
else
{
if ( "generate" =~ /@ARGV[0]/i )
{
generate();
}
elsif ( "decrypt" =~ /@ARGV[0]/i )
{
decrypt();
}
else
{
print "Usage:: generate|decrypt";
}
}

Have anyone experiensed the same problem.

The Crypt-Triple-Des version is 0.24

Cheers
Jonas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top