250 likes | 722 Views
Da Vinci Challenge 2014 - Code Breaking. Due to a teacher vocational exchange in 2010/11, nine teams can compete in 2014. Code breaking (the interpretation of SECRET WRITING) is one of the Da Vinci Challenges
E N D
Da Vinci Challenge 2014 - Code Breaking Due to a teacher vocational exchange in 2010/11, nine teams can compete in 2014. Code breaking (the interpretation of SECRET WRITING) is one of the Da Vinci Challenges This presentation aims to describe simple ways to write secretly (encrypt), and offer routes to interpret secret writings (de-encrypt). ………….. You have already read over hidden words in the subtitle of this slide
Code Breaking Codes & Ciphers Sender Agent Key & plaintext Key & plaintext Algorithm Algorithm CIPHERTEXT CIPHERTEXT Algorithm Algorithm Key & plaintext Key & plaintext To encipher a secret message the Sender uses a formula (Algorithm) to convert Plaintext into CIPHERTEXT, the Agent reverses the process to convert the cipher back to plaintext. Security can be increased by locking the cipher with a Key which is known only to the Sender and his Agent. To break a code, we need to recognise its algorithm, and deduce the key
Code Breaking Coding Algorithms We will look at standard methods of constructing and deconstructing each of these algorithms, and at frequency analysis which is a useful tool to make the initial break into a cipher. But beware, encoders like to include twists and false directions in their ciphers. They use keys to obscure the algorithm, and occasionally hide the whole text.
Code Breaking • STEGANOGRAPHY • (Hidden writing) Due to A teacher Vocational exchange In 2010/11, Nine teams Can compete In 2014. • Messages can be hidden within pictures or within text • Remember a hidden message in the sub-title of slide 1? • This demonstrates the weaknesses of Steganography: • The agent has to know where to look • The agent has to know how to look (the algorithm for DA VINCI was the first letter of every odd numbered word) • The delivery is complicated: embedding messages require a huge amount of text, and the ensuing cipher text is often awkward.
Code Breaking In true codes whole words are replaced by symbols or entirely different words they are only viable if supported by code books (dictionaries) possessed by both the sender and the agent. • ENCODE • (Replace Words) assassinate = D capture = J blackmail = P protect = Z general = S king = q minister = W prince = j Immediately = 08 today = 75 tonight = 28 tomorrow = 4 capture the prince tonight encodes as J j 28 Cockney rhyming slang uses coded words for nouns e.g. MINCE APPLES PLATES DOG TROUBLE WEASEL
Code Breaking • ENCIPHER • by TRANSPOSING letters A simple encoding method involves transposing (scrambling) existing letters, using an algorithm known to the agent. Message IHTSIS CINNAE AEDJYS was encoded by breaking the message into groups of 3 letters, reversing each group, and putting it back together. Reversing the process we get: this/is nice/an d/easy/j- Note j is a null character A more common transposition algorithm is to anagram the message, e.g. ATHEIST IS NOSY – is an anagram of this is not easy Transposition ciphers are very difficult to spot so any in the Da Vinci challenge are likely to be identified as such – unless they are the self evident Railfence or Scytale ciphers, which are described overleaf.
Code Breaking • ENCIPHER • by TRANSPOSING letters Transposition continued Railfence (simple) - imagine a spiked fence with letters arranged as shown c a l c b o t s e p a t s f n r n o i a i r i e i n and written BSCALECTAPSTO.AIRIFNERNOIIN To de-encode, split the code into 2 equal halves and take alternate letters from each half Railfence (multiple groups) To encode just read down the columns to get YCSIE OAIKM UNZEE RBEFS GEYOS RAORA INUTG DYLHE To de-encode, take alternate letters from each block. Of course this would be difficult to break if the size & number of blocks did not match the grid unless the agent knows the size already, or the number of letters is a perfect square: e.g. CEEOBADRK Skytale - demonstration
Code Breaking Substitution Ciphers – non alphabetic • ENCIPHER • by SUBSTITUTING symbols Substitution ciphers where letters are replaced by symbols are the easiest to crack – if the agent knows the symbols, examples are: Pigpen [Masonic] Cipher a pigpen cipher example Baconian [Binary] Cipher AAAAB AAAAA AAABA ABBBA ABBAB ABAAA AAAAA ABBAB AAABA ABAAA ABBBB AABBB AABAA BAAAB baconian cipher To de-encode symbol substitution ciphers like these (and others such as Morse, ASCII, Wingdings & hieroglyphs) simply do a back substitution.
Code Breaking Substitution Ciphers – numeric • ENCIPHER • by SUBSTITUTING numbers Substitution ciphers where letters are replaced by numbers are the easiest to crack – if the agent knows the algorithm. Decipher 4 1 12 2 5 1 20 20 9 5 8 9 7 8 19 3 8 15 15 12 dalbeattie high school That was easy, but beware a common trick is to use descending numbers a=26 to z=1. Now see how using a key number (e.g. 2468) complicates the cipher This message would virtually impossible to decode without the agent having the key number. The consecutive code texts are advanced by differing amounts, even double letters have different codes. However reversing the process is simple.
Code Breaking Substitution Ciphers – numeric • ENCIPHER • by SUBSTITUTING numbers Substitution ciphers where letters are replaced by numbers are the easy to crack – if the agent knows the algorithm. Decipher 4 1 22 9 14 3 9 13 9 12 1 14 da vincimilan That was easy. Now see how using a single key letter (e.g. q) also complicates the cipher Reversing the process is also simple, so long as the agent knows the key letter. ATBASH
Code Breaking Substitution Ciphers – monoalphabetic • ENCIPHER • by SUBSTITUTING letters Monoalphabetic substitution ciphers replace each letter with another letter in the same alphabet, the simplest of these ciphers is the: Atbash Cipher In this cipher the first letter of the alphabet is replaced by the last [A = Z], the second letter by the penultimate [B = Y] and so on, until we get: This cipher was first used in hebrew and its name comes from the hebrew equivalent of A=Z, B=Y which is aleph=tav, beth=shin An interesting quirk of the Atbash cipher is that in english some words encipher into other words, e.g. HOLD IRK ZOO TILT - which deciphers as slow rip all grog
Code Breaking Substitution Ciphers – monoalphabetic • ENCIPHER • by SUBSTITUTING letters Substitution ciphers where letters are replaced by other letters can be the most difficult to crack – unless the agent has the key and algorithm e.g. Caesar Cipher Julius Caesar frequently wrote coded state messages, a frequent Caesar code replaced each letter with one 3 places further down the alphabet thus PHQ IUHHOB EHOLHYH WKDW ZKLFK WKHB GHVLUH is the cipher for men freely believe that which they desire .
Code Breaking Substitution Ciphers – monoalphabetic with key • ENCIPHER • by SUBSTITUTING letters Caesar Cipher with key We saw that using the basic Caesar cipher men freely believe that which they desire we get PHQ IUHHOB EHOLHYH WKDW ZKLFK WKHB GHVLUH But the cipher is made more complex if a key word (e.g. Julius Caesar) is used to displace the letters: In this case we get XSY CFSSWP USWRSMS HEJH NERLE HESP ISGRFS • De-encription requires the cipher alphabet to be rebuilt using the algorithm • Start with the key word(s) without repeated letters • Fill in the remaining letters starting with the next sequential unused letter
Code Breaking Vigenère Cipher (Polyalphabetic) • ENCIPHER • by SUBSTITUTING letters Blaise de Vigenère devised a way of using a series of cipher alphabets and key word(s). Thus using key words Da Vinci for his quotation “ art is never finished only abandoned” we get DRO QF PMYEM NVOQVHZL BOTB AWIAFWPEZ The strength of the Vigenère cipher is that repeat letters only have the same code infrequently, here d is coded L, F & Z Note: the Caesar cipher is row 3!
Code Breaking Eagles, Tits and Ospreys • ENCIPHER • by SUBSTITUTING letters If all else fails a text cipher can be deciphered using letter and word frequency, so long as it is relatively long (100+ letters) Other clues Very few words are without a vowel (e.g. fly wry) Q is always followed by U H frequently goes before E (e.g. the, then, they) but rarely after E Letter frequency/1000 J Q K Z X all <1% Eagles, Tits And Ospreys Inhabit North Scotland – gives top 60% in order. One and 2 letters only 2 one letter words 7 common double repeats in order The = commonest 3 letter word
Code Breaking The preceding slides ran very quickly through the ciphers which I believe you are most likely to meet in the Da Vinci challenge , although I have yet to see a question involving a key locked code, or a polyalphabetic question • ARE YOU AGENT MATERIAL? To prepare for the challenge it will be necessary to run through the slides a few at a time to be able to recognise the different ways to encipher and de-encipher a message. As well as interest in Code Breaking an agent needs to be: Literate Numerate Accurate and comfortable with Etymology Heuristics Quotations So Mr Bond - here’s your first message from M: UZFQDQEFQP?OAZFMOFKAGDFQMYOAMOT
Code Breaking • Decoding M’s message The previous slide contained the code: UZFQDQEFQP?OAZFMOFKAGDFQMYOAMOT ………….. how can we decipher it? • It does not contain numbers, pigpen shapes, hieroglyphs etc so it is probably an alphabetic code • ? is strange but it could be a null character or just punctuation, ignore for now • Does the ? make it a railfence code? ….. No it is not in the middle and taking alternate letters from each group (UOZA etc) does not make sense • Look at the letter distribution ….. There are 4 Qs and 5 Fs (so they are likely to be e, t, a or o) • So is it a transposition code or a substitution code? ….. a transposition code only uses letters in the original message – there are too many Qs for this to be a transposition message (remember Q is one of the <1% letters) • Does it use multiple alphabets (i.e. Vigenere) …. Not likely, no key word has been given • That makes it monoalphabetic (i.e. Caesar), but what is the advancement? … you can find that by using the Vigenere square and finding a row where Q & F are decoded as 2 of e,t,a,or o. Or look at the question ……`a message from M’ hints that the advance is 12 (i.e. M=a, Q=e and F=t). • We now have UZteDeEteP?OAZtaOtKAGDteaYOAaOT….. You can now decode the rest of the message using row 12
Code Breaking Further Information Examples of codes and codebreaking online at http://www.counton.org/explorer/codebreaking/ Books Or have your school’s Da Vinci facilitator contact Geoff Allison via Sue Bain, Piers Butler or Lesley Sloan