#!/usr/bin/perl ## z340crack written by Bowie J. Poag ## ## This script attempts to brute-force crack Quadrant 3 of the Zodiac killer's "Z340" cipher. ## $|=1; ## 1 = Backward B ## 2 = Left half filled circle ## 3 = Filled P ## 4 = Filled circle ## 5 = Backward C ## 6 = Circle with vertical line ## 7 = Butt, left dimple ## 8 = Filled triangle ## 9 = Backward P ## = = Upside-down T ## # = Backward F ## % = Backward Q ## & = Top half filled circle ## : = Backward L ## ; = Circle with horizontal line ## ' = / Forward slash ## { = Square ## } = Southwest filled square ## _ = Caret ## X = Plus sign ## ] = Dot ## ## ## Ciphertext block: YB91TMKO ## T2M]X3BF ## 4FB5678R ## 1]5V2=XX ## E>VUZ4-X ## 9_]#M%G& ## XF:WBI;L ## OSHT'6;9 ## {YOB}-C5 ## ZO8AIK7X ## ## ## ## One liner: YB91TMKOT2M]X3BF4FB5678R1]5V2=XXE>VUZ4-X9_]#M%G&XF:WBI;LOSHT'6;9{YOB}-C5ZO8AIK7X ## $z=0; while ($z>=0) { $#table=-1; $normalAlphabet="abcdefghijklmnopqrstuvwxyz"; $zodiacAlphabet="=>_-;:']{}&#%123456789ABCEFGHIKLMORSTUVWXYZ"; $cipherText="YB91TMKOT2M]X3BF4FB5678R1]5V2=XXE>VUZ4-X9_]#M%G&XF:WBI;LOSHT'6;9{YOB}-C5ZO8AIK7X"; $oldZ=$zodiacAlphabet; $x=0; while($x<100) ### Scramble the alphabet so that symbol selection is random. 100 iterations should do. { $offset=int(rand(length($zodiacAlphabet))); ## Pick a symbol somewhere in the string.. $offset--; $splitter=substr($zodiacAlphabet,$offset,1); $zodiacAlphabet=~/$splitter/; $zodiacAlphabet=$'."$splitter".$`; # Swap the right half and the left half of the match.. $x++; } $x=0; while ($x=3) { print "\n\n\nMATCH FOUND: $cipherText (Count: $signalValue, $signalsFound ), cycle $z\n\n"; open (FILE,">>/tmp/zodiac.txt"); print FILE "\n\n\nMATCH FOUND: $cipherText (Count: $signalValue, $signalsFound ), pass $z\n\n"; $x=0; while ($x0) { print "\n"; print FILE "\n"; } $x++; } close (FILE); print "\n\n"; } $signalValue=0; $signalsFound=""; $signal=""; }