18
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

Da Vinci Challenge 2014 - Code Breaking

  • Upload
    alvis

  • View
    71

  • Download
    0

Embed Size (px)

DESCRIPTION

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 - PowerPoint PPT Presentation

Citation preview

Page 1: Da Vinci Challenge 2014 - Code Breaking

Da Vinci Challenge 2014 - Code BreakingDue 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

Page 2: Da Vinci Challenge 2014 - Code Breaking

Code Breaking

Algorithm AlgorithmKey & plaintext Key & plaintextCIPHERTEXTAlgorithm AlgorithmKey & plaintext Key & plaintextCIPHERTEXT

Sender Agent

Codes & Ciphers

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

Page 3: Da Vinci Challenge 2014 - Code Breaking

SECRETWRITING

STEGANOGRAPHY(Hidden writing)

CRYPTOGRAPHY(Scrambled writing)

TRANSPOSITION(Shuffled)

SUBSTITUTION(Replaced)

ENCODE(Replace Words)

ENCIPHER(Replace, Transpose,

Substitute Letters)

Code BreakingCoding 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.

Page 4: Da Vinci Challenge 2014 - Code Breaking

Code BreakingSTEGANOGRAPHY

(Hidden writing)

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.

Messages can be hidden within pictures or within textRemember a hidden message in the sub-title of slide 1?

Due to A teacher Vocational exchange In 2010/11, Nine teams Can compete In 2014.

Page 5: Da Vinci Challenge 2014 - Code Breaking

Code BreakingENCODE

(Replace Words) 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.

assassinate = D capture = J blackmail = P protect = Z general = S king = q minister = W prince = jImmediately = 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.

APPLES PLATES MINCE DOG TROUBLE WEASEL

Page 6: Da Vinci Challenge 2014 - Code Breaking

Code BreakingENCIPHER

by TRANSPOSING letters

A simple encoding method involves transposing (scrambling) existing letters, using an algorithm known to the agent.

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.

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

Page 7: Da Vinci Challenge 2014 - Code Breaking

Code BreakingENCIPHER

by TRANSPOSING lettersTransposition continued

Railfence (simple) - imagine a spiked fence with letters arranged as shownb

as

ic

ra

il

fe

nc

et

ra

np

os

it

io

n

and written BSCALECTAPSTO.AIRIFNERNOIINTo de-encode, split the code into 2 equal halves and take alternate letters from each half

Railfence (multiple groups)

y o u r g r i dc a n b e a n ys i z e y o u li k e f o r t h

e m e s s a g e

To encode just read down the columns to getYCSIE OAIKM UNZEE RBEFS GEYOS RAORA INUTG DYLHE

To de-encode, take alternate letters from each block.

Skytale - demonstration

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 C E E

O B A

D R K

Page 8: Da Vinci Challenge 2014 - Code Breaking

Code BreakingENCIPHER

by SUBSTITUTING symbols Substitution Ciphers – non alphabetic

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

To de-encode symbol substitution ciphers like these (and others such as Morse, ASCII, Wingdings & hieroglyphs) simply do a back substitution.

A AAAAA £££££ N ABBAB £$$£$B AAAAB ££££$ O ABBBA £$$$£C AAABA £££$£ P ABBBB £$$$$D AAABB £££$$ Q BAAAA $££££E AABAA ££$££ R BAAAB $£££$

AAAAB AAAAA AAABA ABBBA ABBAB ABAAA AAAAA ABBABAAABA ABAAA ABBBB AABBB AABAA BAAAB

baconian cipher

Page 9: Da Vinci Challenge 2014 - Code Breaking

Code BreakingENCIPHER

by SUBSTITUTING numbers

1 a   6 f   11 k   16 p   21 u2 b 7 g 12 l 17 q 22 v3 c 8 h 13 m 18 r 23 w4 d 9 i 14 n 19 s 24 x5 e 10 j 15 o 20 t 25 y                        26 z

Substitution Ciphers – numeric

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

plain text d a l b e a t t i e h i g h s c h o o l

code numbers 4 1 12 2 5 1 20 20 9 5 8 9 7 8 19 3 8 15 15 12

key number 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8 2 4 6 8

CODE TEXT 6 5 18 10 7 5 26 28 11 9 14 17 9 12 25 11 10 19 21 20

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.

dalbeattie high schoolThat 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

Page 10: Da Vinci Challenge 2014 - Code Breaking

Code BreakingENCIPHER

by SUBSTITUTING numbers

1 a   6 f   11 k   16 p   21 u2 b 7 g 12 l 17 q 22 v3 c 8 h 13 m 18 r 23 w4 d 9 i 14 n 19 s 24 x5 e 10 j 15 o 20 t 25 y                        26 z

Substitution Ciphers – numeric

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 vinci milan

That was easy. Now see how using a single key letter (e.g. q) also complicates the cipher

plain text q d a v i n c i m i l a ncode numbers 17 4 1 22 9 14 3 9 13 9 12 1 14add code pairs V V V V V V V V V V V VCODE TEXT 21 5 23 31 23 17 12 22 22 21 13 15

Reversing the process is also simple, so long as the agent knows the key letter.

CODE TEXT 21 5 23 31 23 17 12 22 22 21 13 15Remove leading

code 17 4 1 22 9 14 3 9 13 9 12 1 14plain text d a v i n c i m i l a n

Page 11: Da Vinci Challenge 2014 - Code Breaking

Code BreakingENCIPHER

by SUBSTITUTING letters Substitution Ciphers – monoalphabetic

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:

A B C D E F G H I J K L MZ Y X W V U T S R Q P O N

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

Page 12: Da Vinci Challenge 2014 - Code Breaking

Code BreakingENCIPHER

by SUBSTITUTING letters Substitution Ciphers – monoalphabetic

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 thusPHQ IUHHOB EHOLHYH WKDW ZKLFK WKHB GHVLUH is the cipher formen freely believe that which they desire

.

Page 13: Da Vinci Challenge 2014 - Code Breaking

Code BreakingENCIPHER

by SUBSTITUTING letters Substitution Ciphers – monoalphabetic with key

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 GHVLUHBut the cipher is made more complex if a key word (e.g. Julius Caesar) is used to displace the letters:

Plain a b c d e f g h i j k l m n o p q r s t u v w x y z

CIPHER J U L I S C A E R T V W X Y Z B D F G H K M N O P Q

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

Page 14: Da Vinci Challenge 2014 - Code Breaking

Code BreakingENCIPHER

by SUBSTITUTING letters Vigenère Cipher (Polyalphabetic)

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

plain text a r t i s n e v e r f i n i skey word D A V I N C I D A V I N C I D

CODE TEXT D R O Q F P M Y E M N V O Q V

plain text h e d o n l y a b a n d o n e dkey word A V I N C I D A V I N C I D A V

CODE TEXT H Z L B O T B A W I A F W P E Z

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!

Plain a b c d e f g h i j k l m n o p q r s t u v w x y z1 B C D E F G H I J K L M N O P Q R S T U V W X Y Z A2 C D E F G H I J K L M N O P Q R S T U V W X Y Z A B3 D E F G H I J K L M N O P Q R S T U V W X Y Z A B C4 E F G H I J K L M N O P Q R S T U V W X Y Z A B C D5 F G H I J K L M N O P Q R S T U V W X Y Z A B C D E6 G H I J K L M N O P Q R S T U V W X Y Z A B C D E F7 H I J K L M N O P Q R S T U V W X Y Z A B C D E F G8 I J K L M N O P Q R S T U V W X Y Z A B C D E F G H9 J K L M N O P Q R S T U V W X Y Z A B C D E F G H I

10 K L M N O P Q R S T U V W X Y Z A B C D E F G H I J11 L M N O P Q R S T U V W X Y Z A B C D E F G H I J K12 M N O P Q R S T U V W X Y Z A B C D E F G H I J K L13 N O P Q R S T U V W X Y Z A B C D E F G H I J K L M14 O P Q R S T U V W X Y Z A B C D E F G H I J K L M N15 P Q R S T U V W X Y Z A B C D E F G H I J K L M N O16 Q R S T U V W X Y Z A B C D E F G H I J K L M N O P17 R S T U V W X Y Z A B C D E F G H I J K L M N O P Q18 S T U V W X Y Z A B C D E F G H I J K L M N O P Q R19 T U V W X Y Z A B C D E F G H I J K L M N O P Q R S20 U V W X Y Z A B C D E F G H I J K L M N O P Q R S T21 V W X Y Z A B C D E F G H I J K L M N O P Q R S T U22 W X Y Z A B C D E F G H I J K L M N O P Q R S T U V23 X Y Z A B C D E F G H I J K L M N O P Q R S T U V W24 Y Z A B C D E F G H I J K L M N O P Q R S T U V W X25 Z A B C D E F G H I J K L M N O P Q R S T U V W X Y26 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Page 15: Da Vinci Challenge 2014 - Code Breaking

Code BreakingENCIPHER

by SUBSTITUTING letters Eagles, Tits and OspreysIf all else fails a text cipher can be deciphered using letter and word frequency, so long as it is relatively long (100+ letters)

e 127   d 43   p 19t 91 l 40 b 15a 82 u 28 v 10o 75 c 28 k 8i 70 m 24 x 2n 67 w 24 j 2s 63 f 22 q 1h 61 y 20 z 1r 60   g 20      

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 words7 common double repeats in order

The = commonest 3 letter word

a be or an ssi as on go ee

of at do no ttto so if us ffin we me am llit he my mmis by up oo

Other clues

Very few words are without a vowel (e.g. fly wry)

Q is always followed by UH frequently goes before E (e.g. the,

then, they) but rarely after E

Page 16: Da Vinci Challenge 2014 - Code Breaking

Code BreakingARE YOU AGENT

MATERIAL?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

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

Page 17: Da Vinci Challenge 2014 - Code Breaking

Code BreakingDecoding M’s message

The previous slide contained the code:

………….. 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

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)

Look at the letter distribution ….. There are 4 Qs and 5 Fs (so they are likely to be e, t, a or o)

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

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

UZFQDQEFQP?OAZFMOFKAGDFQMYOAMOT

Page 18: Da Vinci Challenge 2014 - Code Breaking

Code BreakingFurther

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