[BACK]Return to test1.pl CVS log [TXT][DIR] Up to [local] / palm / Palm-Keyring

Annotation of palm/Palm-Keyring/test1.pl, Revision 1.2

1.1       andrew      1: #!/usr/bin/perl
                      2: use strict;
                      3: use warnings;
                      4: 
                      5: use lib 'lib';
                      6: use Palm::Keyring;
                      7: 
                      8: use constant ENCRYPT    =>  1;
                      9: use constant DECRYPT    =>  0;
                     10: 
                     11: my $plaintext = "Hello World";
                     12: my $password  = "12345";
                     13: 
                     14: my $digest    = Palm::Keyring::_calc_keys($password);
                     15: my $encrypted = Palm::Keyring::_crypt3des($plaintext, $digest, ENCRYPT);
                     16: my $decrypted = Palm::Keyring::_crypt3des($encrypted, $digest, DECRYPT);
                     17: 
                     18: print "Plaintext: $plaintext\n";
                     19: print "Password:  $password\n";
                     20: print "Digest:    $digest\n";
1.2     ! andrew     21: print "Encrypted: " . unpack("H*", $encrypted) . "\n";
1.1       andrew     22: print "Decrypted: $decrypted\n";

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>