Annotation of palm/Palm-Keyring/test1.pl, Revision 1.3
1.3 ! 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: print "Plaintext: '$plaintext'\n";
! 15: print "Password: '$password'\n";
! 16:
! 17: my $digest = Palm::Keyring::_calc_keys($password);
! 18: print "Digest: '$digest'\n";
! 19:
! 20: my $encrypted = Palm::Keyring::_crypt3des($plaintext, $digest, ENCRYPT);
! 21: print "Encrypted: '" . unpack("H*", $encrypted) . "'\n";
! 22:
! 23: my $decrypted = Palm::Keyring::_crypt3des($encrypted, $digest, DECRYPT);
! 24: print "Decrypted: '$decrypted'\n";
! 25:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>