#!/usr/bin/perl # uuencode_dict.pl - Don Yang (uguu.org) # # Try all shift+xor combinations to see what we can do to remove the # backslash character. # # 09/05/14 $dict = q{!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`}; $dict = lc $dict; for($i = -33; $i < 255 - 96; $i++) { $shift_dict = ""; foreach (unpack 'C*', $dict) { $shift_dict .= chr($_ + $i); } for($j = 0; $j < 256; $j++) { $xor_dict = $shift_dict ^ (chr($j) x length($shift_dict)); for($k = 0; $k < length($xor_dict); $k++) { $c = substr($xor_dict, $k, 1); last if( $c eq '\\' || ord($c) < 33 || ord($c) > 126 ); } if( $k == length($xor_dict) ) { print "$i $j $xor_dict\n"; } } }