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

Discussion in 'Perl' started by Jonas, Oct 10, 2003.

  1. Jonas

    Jonas Guest

    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
     
    Jonas, Oct 10, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AdrianK
    Replies:
    0
    Views:
    1,564
    AdrianK
    Jul 9, 2003
  2. Lech Migdal

    encrypt with TripleDES, decrypt with DES, doesnt work ?

    Lech Migdal, Apr 7, 2004, in forum: ASP .Net Security
    Replies:
    1
    Views:
    220
    Hernan de Lahitte
    Apr 7, 2004
  3. Cosmia Luna
    Replies:
    4
    Views:
    341
    Cosmia Luna
    Mar 11, 2012
  4. asg

    de-crypt... crypt

    asg, Dec 23, 2005, in forum: Perl Misc
    Replies:
    3
    Views:
    142
  5. Steve
    Replies:
    4
    Views:
    207
    Steve
    Oct 25, 2007
Loading...

Share This Page