Annotation of palm/Palm-Keyring/test1.pl, Revision 1.1
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";
! 21: print "Encrypted: $encrypted\n";
! 22: print "Decrypted: $decrypted\n";
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>