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E "" 0 259 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {PARA 256 "" 0 "" {TEXT -1 6 "ACCESS" }}{PARA 258 "" 0 "" {TEXT -1 20 "Substitution ciphers" }}{PARA 257 "" 0 "" {TEXT -1 25 "No tes for Tuesday June 12" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 295 "1) We will play with the Caeser shift code at Prof essor Carlson's Web page, go to http://www.math.utah.edu/~carlson, the n follow the links to Undergraduate Colloquia/Cryptography. We could \+ break his message by hand too, since there are only 26 possible decodi ngs of a Ceaser-shifted message. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 31 "Enter the decoded message here:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 103 "We will discuss the truth of decoded message! It's proof is related to the scientific me thod! Honest!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 305 "2) Following the conventions \+ in \"The Code Book\", we will use upper case letters for encrypted mes sages and lower case letters for decoded versions. So, assuming a mes sage of upper case letters is encrypted via a substitution cipher, how many ways could we have encrypted it? (It sure seems like a lot.)" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 898 "3) Happ ily, despite this large number of possibilities, substitution ciphers \+ relatively easy to break. That is one reason that solving cryptograms is a popular past-time. On a less happy note, Mary Queen of Scots al so found this out, even though her coding method was a little more sop histicated than a substitution cipher. The attack method for such cod es is to use language clues: mainly frequency analysis of individual l etters and of repeating multi-letter patterns (possible words). We co uld do this work by hand, but the computer was made to help us avoid s uch things. In fact, some people say that the idea of modern computer s originated with one of history's most famous cryptographers, Alan Tu ring, see page 167 of \"The Code Book.\" He was one of the primary pe ople involved in the stuccessful struggle to break the unbelievably c omplicated German \"Enigma\" code during World War II." }}{PARA 0 "" 0 "" {TEXT -1 347 " Here are some Maple procedures which will help us carry out frequency analysis. We will also use the letter frequen cy table on page 19 of \"The Code Book\". Let's use the following m essage to test our procedures on. Notice Maple requires you to enclose letters in quotes when they are representing text as opposed to mathe matical variables." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 177 "MSG1: =\"WHAT DO YOU MEAN THIS MESSAGE IS ENCODED. IT SURE DOESN'T LOOK TOO \+ HARD TO READ TO ME. IT WOULD HAVE BEEN A LOT HARDER IF YOU HAD ACTUAL LY CHANGED SOME OF THE LETTERS.\";" }}{PARA 12 "" 1 "" {XPPMATH 20 "6# >%%MSG1GQcuWHAT~DO~YOU~MEAN~THIS~MESSAGE~IS~ENCODED.~IT~SURE~DOESN'T~L OOK~TOO~HARD~TO~READ~TO~ME.~~IT~WOULD~HAVE~BEEN~A~LOT~HARDER~IF~YOU~HA D~ACTUALLY~CHANGED~SOME~OF~THE~LETTERS.6\"" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 256 27 "4) Single letter frequency" } {TEXT -1 50 ", upper case letters, by percent of total letters:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 695 "count1 := proc(Z) #Z is a string of characters\n local \+ C, # Character being processed\n counts, \+ # Table of character counts\n L, # Length of Z\n i; #index\n\n for C from \"A\" to \"Z\" do c ounts[C] := 0 od;\n #initialize counts array\n L:=length( Z);\n #L is the number of characters in Z\n\n # Get chara cter count:\n for i from 1 to L do\n C:=Z[i];\n \+ if C >= \"A\" and C <= \"Z\" then\n counts[C] := c ounts[C] + 1\n fi\n od;\n # Display a table of th e counts.\n for C from \"A\" to \"Z\" do\n print(C,evalf(100 *counts[C]/L));\n od;\nend:\n " }}}{PARA 0 "" 0 "" {TEXT -1 83 "c ount1 our test message! How do the percentages compare with the table on page 21?" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 257 1 "5" }{TEXT -1 3 ") " } {TEXT 258 20 "2 letter word counts" }{TEXT -1 15 " - actual words" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1208 "count2 := proc(Z) #written assuming message has\n \+ #kept punctuation, to count\n #t wo letter words\n local C1,C4, # non-letter characters\n \+ C2,C3, #letter characters\n i, #index in list\n counts, #Table of word counts\n L ; #List length\n # Clear the table of character counts.\n \+ for C2 from \"A\" to \"Z\" do \n for C3 from \"A\" to \"Z\" do \n counts[C2,C3] := 0 od;od;\n L:=length(Z);\n\n for i f rom 1 to L-4 do\n C1:=Z[i];\n C2:=Z[i+1];\n C3:=Z [i+2];\n C4:=Z[i+3];\n if (C1 < \"A\" or C1 > \"Z\" ) #C1 not a letter\n and (C2>=\"A\" and C2<=\"Z\") #C2 a l etter\n and (C3>=\"A\" and C3<=\"Z\") #C3 a letter\n \+ and (C4<\"A\" or C4>\"Z\") #C4 not a letter\n then \n counts[C2,C3]:=counts[C2,C3]+1;\n fi;\n od ;\n # Display a table of the counts, if they have at least\n # o ne occurence:\n for C2 from \"A\" to \"Z\" do\n for C3 from \" A\" to \"Z\" do\n if counts[C2,C3]>=1\n then print(cat(C2, C3),counts[C2,C3]);\n #cat is the concatinate command\n \+ fi;\n od;od;\nend:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 26 "Test coun t2 on our message" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 259 "" 0 "" {TEXT -1 17 "6) 3 letter words" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1155 "count3 := proc(Z) \+ #three letter words\n local C1, C5, #non-letters\n \+ C2,C3,C4, #letters\n i, #index in list \n counts, #Table of character counts\n L; #List length\n # Clear the table of character counts.\n for C2 from \"A\" to \"Z\" do \n for C3 from \"A\" to \"Z\" d o\n for C4 from \"A\" to \"Z\" do\n counts[C2,C3,C4] := \+ 0 od;od;od;\n L:=length(Z);\n\n for i from 1 to L-4 do\n \+ C1:=Z[i];\n C2:=Z[i+1];\n C3:=Z[i+2];\n C4:=Z[i+ 3];\n C5:=Z[i+4];\n if (C1<\"A\" or C1>\"Z\")\n \+ and (C2 >= \"A\" and C2 <= \"Z\")\n and (C3>=\"A\" \+ and C3<=\"Z\") \n and (C4>=\"A\" and C4<=\"Z\")\n \+ and (C5<\"A\" or C5>\"Z\")\n then\n counts[C2,C 3,C4]:=counts[C2,C3,C4]+1;\n fi;\n od;\n # Display a \+ words with non-zero counts\n for C2 from \"A\" to \"Z\" do\n f or C3 from \"A\" to \"Z\" do\n for C4 from \"A\" to \"Z\" do\n \+ if counts[C2,C3,C4]>=1\n then print(cat(C2,C3,C4),counts[C 2,C3,C4]);\n #cat is the concatinate command\n fi;\n \+ od;od;od;\nend:\n " }}}{PARA 0 "" 0 "" {TEXT -1 10 "Test it! " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 259 38 "7 ) YOUR GROUP ASSIGNMENT FOR TODAY: " }{TEXT -1 361 "Decode the follo wing message. Create a Microsoft Word document in which you include b oth the coded and decoded message, and also include the decoding key. \+ Email your document to me, korevaar@math.utah.edu, as an attachment. \+ Make sure you list your group members at the top of your document. H int: You may want to see Appendix B, page 391 of \"The Code Book.\"" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 664 "MSG2:=\"SDDUNN HN S NDPGCSM NPHJ QPSQ GOOUMN SJJMGYHESQUCW QXUFQW XGEUF TFHKTU UYJUMHUFDUN SFR GJJ GMQTFHQHUN HF NDHUFDU SFR QUDPFGCGLW. SF SDDUNN NDPGCSMNPHJ MUDHJHUFQ \+ NJUFRN QPU NTEEUM GO PUM OMUNPESF WUSM XHQP NGEU GO QPU IMHLPQUNQ XGEU F UFQUMHFL QPU TFHZUMNHQW GO TQSP. HF S NJUDHSCCW RUNHLFUR DGTMNU QSTL PQ IW NGEU GO QPU TFHZUMNHQW'N EGNQ UFQPTNHSNQHD SFR DUCUIMSQUR JMGOUN NGMN, NPU HN HFQMGRTDUR QG PSFRN-GF UYJUMHUFDU XHQP MUSC-XGMCR JMGICUE N QPMGTLP HFNQMTDQHGF, CSIGMSQGMW XGMB SFR QUSE XGMB GF SNNHLFUR JMGAU DQN. QPU DCSNN HN NJUDHSCCW RUNHLFUR QG LHZU JSMQHDHJSFQN FGQ GFCW ZSC TSICU CSIGMSQGMW UYJUMHUFDU, ITQ SCNG S QSNQU GO USDP GO QPU ESAGM NDH UFDUN.\";" }}{PARA 12 "" 1 "" {TEXT -1 0 "" }}}}{MARK "46" 0 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }