Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

z340crack : A Tool For Brute-Force Cracking The Zodiac Serial Killer's Z340 Cipher.

by bpoag (Monk)
on Jun 22, 2011 at 16:48 UTC ( #910936=CUFP: print w/ replies, xml ) Need Help??

#!/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&X +F:WBI;LOSHT'6;9{YOB}-C5ZO8AIK7X"; $oldZ=$zodiacAlphabet; $x=0; while($x<100) ### Scramble the alphabet so that symbol select +ion 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 ha +lf and the left half of the match.. $x++; } $x=0; while ($x<length($zodiacAlphabet)) { $l=length($zodiacAlphabet); $thisSymbol=substr($zodiacAlphabet,$x,1); $letter=int(rand(length($normalAlphabet))); $table[$letter].="$thisSymbol"; $x++; } ## The table has now been built. All letters in the normal alp +habet now have a random number of zodiac symbols assigned to them. $x=0; $x=0; $y=0; while ($x<length($normalAlphabet)) ## For every letter of the +normal alphabet, replace the symbols assigned to it in the cipher. { $thisLetter=substr($normalAlphabet,$x,1); $y=0; while($y<length($table[$x])) { $thisSymbol=substr($table[$x],$y,1); $cipherText=~s/$thisSymbol/$thisLetter/g; $y++; } $x++; } $z++; ## Look for pay dirt.. ## The misspellings here are intentional, taken from known exm +aples ## of the Zodiac killer's previous writings. A match on any of + these ## words would be a hint of a significantly stronger "signal" +among ## the noise. @signalWords=("children","others","around","shall","about","pe +ople","would","missed","police","because","thing","there","could","ra +ther","light","school","vallejo","useing","triger","howers","cerous", +"meannie","killed","victom","speaking","lyeing","slaves","afterlife", +"zodiac","intersting","idenity","woeman","untill"); foreach $signal (@signalWords) { if ($cipherText=~/$signal/) { $signalValue++; $signalsFound.=" $signal"; } } if ($z%9==0) { print "Processing: Pass #$z [$cipherText]\r"; } if ($signalValue>=3) { print "\n\n\nMATCH FOUND: $cipherText (Count: $signalV +alue, $signalsFound ), cycle $z\n\n"; open (FILE,">>/tmp/zodiac.txt"); print FILE "\n\n\nMATCH FOUND: $cipherText (Count: $si +gnalValue, $signalsFound ), pass $z\n\n"; $x=0; while ($x<length($normalAlphabet)) { $thisLetter=substr($normalAlphabet,$x,1); print "\t$thisLetter equals ($table[$x])"; print FILE "\t$thisLetter equals ($table[$x])" +; if ($x%4==0 && $x>0) { print "\n"; print FILE "\n"; } $x++; } close (FILE); print "\n\n"; } $signalValue=0; $signalsFound=""; $signal=""; }

Comment on z340crack : A Tool For Brute-Force Cracking The Zodiac Serial Killer's Z340 Cipher.
Download Code
Re: z340crack : A Tool For Brute-Force Cracking The Zodiac Serial Killer's Z340 Cipher.
by davido (Archbishop) on Jun 23, 2011 at 02:56 UTC

    Fun concept. Those sorts of puzzles can be fun to implement.

    Didn't the Zodiac Killer have a spell checker?

    @signalWords=( "children","others","around","shall","about", "people","would","missed","police", "because","thing","there","could","rather", "light","school","vallejo","useing","triger", "howers","cerous","meannie","killed","victom", "speaking","lyeing","slaves","afterlife", "zodiac","intersting","idenity","woeman", "untill" );

    How about:

    @signal_words = qw/ children others around shall about people would missed police because thing there could rather light school vallejo using trigger hovers curious meanie killed victim speaking lying slaves afterlife zodiac interesting identity woman until /;

    I had to guess on hovers and curious.

    Maybe you know something I don't. Is it a known fact that he wrote some of the words wonkily? (That's a new word, I think.)

    :) Next get to work on the question that was answered by 42.


    Dave

Re: z340crack : A Tool For Brute-Force Cracking The Zodiac Serial Killer's Z340 Cipher.
by je44ery (Hermit) on Jul 19, 2011 at 16:48 UTC

    How long is this supposed to take? On my box it has taken almost 12 calendar days and just about as much CPU time.

    me@mybox:~/sandbox $ date ; ps -ef | grep zod Tue Jul 19 12:36:08 EDT 2011 me 9267 1 0 Jul07 ? 00:00:00 time ./zod.pl me 9268 9267 99 Jul07 ? 11-19:49:32 /usr/bin/perl ./zod +.pl me 12255 12193 0 12:36 pts/5 00:00:00 grep zod me@mybox:~/sandbox $ ps -o etime -p 9268 ELAPSED 11-21:45:38

    My box is not wimpy from what I can tell about Intel hardware these days.

    me@mybox:~/sandbox $ head -n 14 /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Xeon(R) CPU E7320 @ 2.13GHz stepping : 8 cpu MHz : 2133.050 cache size : 2048 KB fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge + mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss syscall lm +pni cx16 lahf_lm bogomips : 4374.81

      Still going strong at 20+ days

      me@mybox:~/sandbox $ ps -o etime -p 9268 ELAPSED 20-21:13:15

      I now realize the joke is on me. There is no place in the while ($z>=0) loop that $z will ever get set to below 0. No wonder I've been running this now for 45 days without end!

        This script will run forever, producing output and dumping a key when 3 or more "signal words" are found in the noise. Seeing upwards of 3 would yeild a key that would be close enough to a solution that the remainder could be deciphered by human eyes. It's a comprimise between the need for building a very fast engine, and the need to have a strict dictionary check of every possible word. Given the enormous keyspace we're dealing with, it's mathematically unlikely to yeild a full solution in our lifetime. This tool attempts to render partial solutions which warrant human appraisal.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://910936]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2014-09-19 00:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls