test 531 B

123456789101112131415161718192021222324252627
  1. #!./perl
  2. BEGIN { push(@INC, qw(../../../lib ../../lib ../lib lib)); }
  3. use DES;
  4. $key='00000000';
  5. $ks=DES::set_key($key);
  6. @a=split(//,$ks);
  7. foreach (@a) { printf "%02x-",ord($_); }
  8. print "\n";
  9. $key=DES::random_key();
  10. print "($_)\n";
  11. @a=split(//,$key);
  12. foreach (@a) { printf "%02x-",ord($_); }
  13. print "\n";
  14. $str="this is and again into the breach";
  15. ($k1,$k2)=DES::string_to_2keys($str);
  16. @a=split(//,$k1);
  17. foreach (@a) { printf "%02x-",ord($_); }
  18. print "\n";
  19. @a=split(//,$k2);
  20. foreach (@a) { printf "%02x-",ord($_); }
  21. print "\n";