20
Code Challenge 2020! Will you be able to hack the code? Name: ________________ Junior School: __________________

Will you be able to hack the code? · 2020-06-24 · Caesar Shifts The Caesar Shift is one of the simplest codes we come across in cryptography. It is a substitution code, which means

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Code Challenge

2020!

Will you be able to

hack the code? Name: ________________

Junior School: __________________

Why study codes in maths?

There is a long history of mathematicians being used

in code making and code breaking - the most famous is

probably the Bletchley Park code breakers, where

some of the most brilliant mathematicians in the

country such as Alan Turing worked in secret to crack

the German WWII Enigma code. The picture above

shows an Enigma machine. The code was so

complicated that the Germans were confident that it was unbreakable, however the men and women

at Bletchley Park were able to crack it using incredible ingenuity. This meant that the allies were able

to intercept and understand German communications – a huge breakthrough in the war.

Codes now play an integral part in all our lives - from the ISBN codes on the back of every book you

buy, to the algorithm that checks if the credit card you've entered is genuine, from the encrypted data

sent via the internet to the content you watch on digital TV.

Mathematicians are employed throughout a wide range of industries that send and transmit data – in

particular the telecommunications industry and internet companies. Their challenge is to condense

the data that needs to be sent to as small a file as possible – whilst also allowing potential errors in

communication to be noticed by the receiver. As coding now goes hand in hand with computing skills,

good mathematicians are highly sought after for computing courses at top universities around the

world.

There is also still a need for the traditional code

makers and code breakers. Highly sensitive data

needs to be encrypted to prevent it from falling into

the wrong hands – whilst our spies need to be able

to crack the codes of other countries. Indeed, GCHQ

(the British Intelligence Agency responsible for

digital communications) last year recruited new

employees by posting a code online. Crack the code

and you secured yourself an interview.

Therefore, codes and coding theory represents a varied and interesting career path for good

mathematicians. Get cracking!

Key Words

Below is a list of words that you need

understand as we will be using them lots in this

project!

Fill in the empty boxes with the definitions for

each word.

Cryptography

Cryptographer

Code

Cipher

Encrypt

Decipher

Letter Numbers

This is one of the first codes that people often learn as it is super simple!

For this code, each letter is given a number, with each number being separated

by a hyphen. This helps to stop any confusion over what the numbers are.

2-5 is BE whereas if we have no hyphen 25 is the letter Y.

Each word is separated by a space so it is easy to see how the length of each

word. This causes an issue though as it makes these codes a lot easier to

break. There are only a two one letter words, a and I so if your message

contains either of these then it is really quick to crack the code and decipher

the message!

Due to this problem, this coding system is not often used but it is a great place

for us to start!

Challenge 1 - Letter Numbers

Using the table below, try and decipher these coded messages.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

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

1) 2-5 3-1-18-5-6-21-12

2) 23-5 1-18-5 2-5-9-14-7 23-1-20-3-8-5-4

3) 9 11-14-15-23 23-8-5-18-5 20-8-5 20-18-5-1-19-21-18-5 9-19

4) 6-21-18-20-8-5-18 4-5-20-1-9-12-19 20-15 3-15-13-5

5) Code the name of the secondary school you will be going to in

September!

____________________________________________________________

Caesar Shifts

The Caesar Shift is one of the simplest codes we come

across in cryptography. It is a substitution code, which

means that each letter is replaced with another one. The

code is named after the Roman Emperor Julius Caesar who

use this method to send military messages to his army.

To encrypt or decrypt a Caesar shift we first list the

alphabet, and then for a Caesar shift of three, we move every letter of the

alphabet 3 places:

Here we would decode X as A, Y as B etc. So the message EBIIR translates to

HELLO.

Caesar shift codes can be easily broken by conducting simple frequency

analysis. If you count the frequency of each of the letters in the code, you can

then compare these frequencies with how often they appear in English.

Looking at the frequencies we can see that:

So, in a long message we would expect the most frequent code letter to

correspond to E. That would be enough to crack the code. If that doesn’t work,

try T or A etc.

Challenge 2 – Caesar Shift Codes

For the questions below use a shift 2 code. It has been started for you!

Original 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

Code A B C D E F

1) RFC-RPCYQSPC-GQ

_____________________________________________________________

2) GL-Y-ZSQW-NJYAC

_____________________________________________________________

3) NCMNJE-UCYP-KYRAFGLE-RMNQ

_____________________________________________________________

For these questions use a shift 6 code. It has been started for you!

Original 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

Code A

4) CN-WUH-AYN-PYLS-FIOX

____________________________________________________________

5) YMJYWCUGGS-IH-QYYEYHXM

____________________________________________________________

6) U-JIJOFUL-MJILN-CM-JFUSYX-BYLY

____________________________________________________________

Where do you think the treasure is?

Pig Pen Ciphers

The Pig Pen cipher is also known as the Tic-

Tac-Toe cipher. In this code each letter is

replaced with a symbol from the grids to the

left.

This cipher is thought to have been used mostly

in the 18th century by a very secret society known

as the Freemasons. It was also used by

prisoners of war during the American Civil War,

To use this, you copy down the lines and dots that the letter is touching. For

example, the letter E would be shown as . The letter W would be written as

.

If we were to encrypt the word ‘Maths’ it would look like

There are several versions of this code where letters have been placed in a

different order in the grids, the one shown above is the most common

configuration. The trickiest part of this cipher is that it does not show you when

each word starts and ends so it is down to the person decrypting to work that

out.

This cipher is still used today but

mostly in games and novels. For

example, this can be seen in the

game Assasin’s Creed II and the

TV series of Sherlock.

Challenge 3 – Pig Pen Ciphers

Decode the following messages using the grid from the previous page.

1)

_____________________________________________________________________

_____________________________________________________________________

2) __________________________

3) ___________________________

4) ___________________________

5) ___________________________

6) ___________________________

Book Ciphers

This cipher involves the use of a book. The person who is encrypting the

message and the person decrypting the message must have the same book.

This means that the two people need to have the same edition of the book

released in the same year. The book should be a common one, that would look

inconspicuous on somebody’s bookcase.

The person encrypting the message, turns to a random page in the book. The

page number is written at the top of the message. You then number each word

on the page. To encrypt the message, you look at what letter you need and pick

the word that starts with that letter in the book. You then write down the

number of that word as shown above.

The more common book you choose the harder it is to break the code. Each

time the message will be different as a different page will be chosen. This is

most often used in TV shows and movies but that’s not to say people do not use

it in real life. What books would you use?

Challenge 4 – Book Ciphers

Using the passage below from a Harry Potter novel, decode and the code the

following messages.

October arrived, spreading a damp chill over the grounds and into the

castle. Madam Pomfrey, the nurse, was kept busy by a sudden spate of

colds among the staff and students. Her Pepperup potion worked

instantly, though it left the drinker smoking at the ears for several hours

afterward. Ginny Weasley, who had been looking pale, was bullied into

taking some by Percy. The steam pouring from under her vivid hair gave

the impression that her whole head was on fire.

1) 14, 4, 50, 74, 13.

___________________________________________________________

2) 32, 4, 6, 19, 38, 17, 50/11, 47/14, 4, 12, 32, 47

___________________________________________________________

3) 13, 1, 5, 45/37, 32, 45/31, 45, 17, 28, 45, 17, 6, 45, 47/ 58, 45, 55, 80, 51.

__________________________________________________________

4) What is missing on this page?

Code your answers to these questions:

5) What is the best part of maths?

6) What is the worst part of maths?

7) What are you keen to learn?

Morse Code

Morse code is one of the most well-known codes and is

still used by pilots and air traffic controllers. Although it

is a code, due to the amount of people who know Morse

code, it is often not used to conceal messages but just

as an alternative method of communication. It was

invented in the early 19th century by Samuel Morse.

In Morse code every letter has been turned into a series

of dots and dashes. On top of every letter being encrypted so have some

punctuation marks and all numbers from 0 to 9.

The benefit of Morse code is that it does not require the message to be written

down. The coded message can be shown by a light flashing and staying on or by

noise through a telegraph using short and long beeps. It takes a lot of skill and

practise to be able to decode Morse at high speed. During World War II women

were trained at Bletchley Park to be able to intercept and decipher Morse code

messages which could then be passed

on to help protect the soldiers from

incoming attacks.

Due to the code being easy to read, a

new code was created known

as the Enigma code. This is how

the Nazi’s managed to send tactical

messages to various groups in

their armies. This code was a

lot harder to crack and

something you will learn about in Year 9.

Challenge 5 – Morse Code

Decode the following messages to identify the spy!

Transposition Ciphers

Transposition Ciphers are based on a simple idea, but are more difficult to

crack that codes like the Caesar shift. A transposition means that the letters

of the code are simply rearranged into a different order.

For example, ICBKAOREMDERAEAA, can be rearranged into rows of length 4 to

give:

The message is then read from down the columns – I am a codebreaker.

Try and solve:

1) TIOICCBKTHSRFUORIEIAEFLDENSSMDITEAGT (make 4 rows of length 9)

2) WTFRUELEHQRHIOSADUITUEASUQRPSGSAD (make 3 rows of length 11)

Another transposition Cipher used by the Romans was called the Scytale. This

involved putting a message on a strip of paper that could only be read when

wrapped around a rod of a given length. An example is given below:

Challenge 6 – Transposition Ciphers

1) IEOHPSVMDNDUETOEUEEYRLOLARR (3 lines of 9).

2) NAEEIONASNBKRTGONEITDOIGHYWNAICWVTS (7 lines of 5)

3) YLLCSONLOKUEYDIWEOILIDUNLLARGS (There are 30 letters)

4) IIBATLERWLHD (There are 12 letters)

Murder Mystery

There has been a shocking murder at HTC! Mr Elliott was

boogying away in his classroom and suddenly collapsed, it

was a murder on the dance floor! But who did it? How did

they do it? Why did they do it? Mr Elliott knew something

was wrong so left some codes to help us!

It is your job to find:

1) The murderer

2) The murder weapon

3) Where the murderer is hiding

The suspects:

1) Miss Clitheroe - who was wearing a blue and white, T-shirt with 2 stripes and

ripped jeans on the day of the murder.

2) Miss Smith - who was wearing a knee-length green skirt, white blouse and

gold watch.

3) Mr Welch - who was wearing a blue Adidas T-shirt with 3 stripes on the

sleeves, Bermuda shorts and a baseball cap.

4) Mr Evans - who was wearing a black and white pin-stripe suit with shiny

black shoes.

5) Mr Dryburgh - who was wearing a blue knitted jumper with a picture of pi on

the front, and brown cords.

Murder Weapon:

1) Poison

2) A large metal stapler

3) A wrench

4) A sharp compass

5) A lamp

6) An oversized calculator

You need to go through and decipher the codes that Mr Elliott left to help

identify the killer!

Finding the Killer

Clue 1 (Letter Numbers): 20-8-5 11-9-12-12-5-18 23-1-19 23-5-1-18-9-14-7

20-18-15-21-19-5-18-19

Clue 2:

Clue 3 (Book Cipher): 3, 32, 45/76, 4, 5/27/20, 39, 68, 45/27, 17, 5/51, 76, 74,

73, 45/64, 7, 15.

The murderer is ____________________________________________________

Possible hiding spaces:

1) Reception

2) X Block Canteen

3) The roof

4) Mrs Summerfield’s office

5) Caretaker’s Closet

Finding the weapon

Clue 1: .. -/ .. …/ -- .- - …. . -- .- - .. -.-. .- .-..

Clue 2 (Caesar Shift 3): FQ-TXP-X-PJXII-FQBJ

Clue 3: IPWCTECCCOIUAPRRNLCAHELTEDEELRSLPAAY. (Try writing this as 9 lines

of 5)

The weapon is _____________________________________________

Finding where they are hiding out

Clue 1 (Transposition): SSTTPEHWIOIDEANBCUIIGEKP

Clue 2 (Caesar Shift): GR – GQ – TCPW – OSGCR

You can use frequency analysis to help with this one!

Clue 3 (Transposition): SGSANECTHEAYALOEETWIHIPR

The murderer is hiding ________________________________________.

The Final Challenge

This is your final challenge. Below are links to a set of videos. For each video

you must decode the passwords that I have written below. Follow the

instructions in the videos to help create a coding machine. You will need this

for your first two lessons in September!

All passwords are lowercase.

Video 1: https://vimeo.com/421499172

Password - Letter Number Code: 3-9-16-8-5-18.

Video 2: https://vimeo.com/421502972

Password:

Video 3: https://vimeo.com/421508314

Password - Casear Shift 2: CLAPWNR

Video 4: https://vimeo.com/421508314

Password: Transposition cipher (3 lines of 4)

CPGPRTRHYOAY

Video 5: https://vimeo.com/421508314

Password: ... . -.-. .-. . - ...