#!/usr/bin/perl -w # xor_table.pl - Don Yang (uguu.org) # # Output all XOR combinations use strict; for(my $key = 0; $key < 128; $key++) { my $output = ""; my $error = 0; for(my $i = 32; $i < 127; $i++) { my $c = chr($i) ^ chr($key); if( ord($c) <= ord(' ') || ord($c) >= 127 ) { $c = ' '; $error++; } $output .= $c; } printf 'key=%3d (0x%02x) space=%2d%s%s'."\n", $key, $key, $error, (' ' x 8), $output; }