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
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