aboutsummaryrefslogtreecommitdiff
path: root/3rdparty/des-4.04b/t/test
diff options
context:
space:
mode:
authorneonloop2021-10-20 14:54:27 +0000
committerneonloop2021-10-20 14:54:27 +0000
commitea1947ffcc606d757357398b24e74a3f4ecefa07 (patch)
tree2031b8d4fc4c61063c710a7148378f57e662efbd /3rdparty/des-4.04b/t/test
downloadbennugd-ea1947ffcc606d757357398b24e74a3f4ecefa07.tar.gz
bennugd-ea1947ffcc606d757357398b24e74a3f4ecefa07.tar.bz2
bennugd-ea1947ffcc606d757357398b24e74a3f4ecefa07.zip
Initial commit from steward-fu releasemain
Diffstat (limited to '3rdparty/des-4.04b/t/test')
-rw-r--r--3rdparty/des-4.04b/t/test27
1 files changed, 27 insertions, 0 deletions
diff --git a/3rdparty/des-4.04b/t/test b/3rdparty/des-4.04b/t/test
new file mode 100644
index 0000000..97acd05
--- /dev/null
+++ b/3rdparty/des-4.04b/t/test
@@ -0,0 +1,27 @@
+#!./perl
+
+BEGIN { push(@INC, qw(../../../lib ../../lib ../lib lib)); }
+
+use DES;
+
+$key='00000000';
+$ks=DES::set_key($key);
+@a=split(//,$ks);
+foreach (@a) { printf "%02x-",ord($_); }
+print "\n";
+
+
+$key=DES::random_key();
+print "($_)\n";
+@a=split(//,$key);
+foreach (@a) { printf "%02x-",ord($_); }
+print "\n";
+$str="this is and again into the breach";
+($k1,$k2)=DES::string_to_2keys($str);
+@a=split(//,$k1);
+foreach (@a) { printf "%02x-",ord($_); }
+print "\n";
+@a=split(//,$k2);
+foreach (@a) { printf "%02x-",ord($_); }
+print "\n";
+