The book of coding and ciphering

Page 1

THE BOOK OF CODING AND CIPHERING for young learners

Created by participants of eTwinning project „Following Enigma” students and teachers from: Základná škola Hlavná 5 in Družstevná pri Hornáde, Slovakia Zespół Szkół in Zabór, Poland

2016


WHO ARE WE? We're a group of 29 students and 2 teachers who are interested in ciphering and coding. Everything started when Polish students learned during their History lesson that people who solved the secret of the most famous ciphering machine, Enigma, were Polish. Students from Zabór wrote to their friends in Slovakia – a year before they had created a wonderful project about names together, so Polish students believed this time could be successful, too. And, of course, they were right :) During one school year we all learnt a lot about the history of Enigma and the basic methods of ciphering and coding. We took part in the Hour of Coding and we were exchanging interesting websites about coding (there's a list of useful websites at the end of this book). There were many people who helped us: Maths and IT teachers from our schools, students and teachers from Balikesir Bilim ve Sanat Merkezi School in Balikesir, Turkey and Luxemburg School in Meaux, France. We are very grateful to all of them and we want to say a big THANK YOU! to them. We hope you will like our book – we think it's great!


LESSON 1 SUBJECT: Binary system coding.

(task prepared by Turkish students, January 2016)

BINARY SYSTEM – it’s a coding system in which number 2 is the most important. To write a sign in this system you can use only two numbers: 0 or 1. Each sign consists of 8 elements – to read it, you have to start from the right and multiply each element by 2 raised to the 0, 1, 2, 3, 4, 5, 6 and 7 power, e.g. 27 26 25 24 23 22 21 20 0 1 0 1 0 0 0 0 How to count it: 20 x 0 = 0 21 x 0 = 0 22 x 0 = 0 23 x 0 = 0 24 x 1 = 16 25 x 0 = 0 26 x 1 = 64 27 x 0 = 0 When you finish it, you have to sum up the results: 0 + 0 + 0 + 0 + 16 + 0 + 64 + 0 = 80 After that you have to find the final result (80) in the ASCII chart (read: aski). ASCII is the basic code in which you can replace a letter by a number. When you find the number, read the letter which is assigned to it: 80 = P


THE HISTORY OF BINARY SYSTEM: The binary system was first used in XVI century by John Napier, who decided to replace numbers 0 and 1 with letters a and b. The father of the modern binary system is Gotfried Wilhelm Leibniz (in 1703 he wrote an article titled Explication de l’Arithmetique Binaire). Nowadays binary system is commonly used in electronics and IT. ASCII CHART:

EXERCISE. Remember the task from Turkish students from the beginning of this lesson? Try to decode their message, using the ASCII chart. ………………………………………………………………………………………………………… ………………………………………………………………………………………………………… …………………………………………………………………………………………………………


LESSON 2 Do you remember? - during our first lesson we learned how to code messages using binary system - the binary system is based on two numbers: 0 and 1 - to read a message coded with binary system, you usually need the ASCII chart SUBJECT: Polybius cipher. Polybius was a Greek historician. He wrote the history of the Roman empire at the times of republic. When he was creating his 40 volumes of „The history of Rome” he was always taking care about writing the truth. He hated gossping and lies. Polybius cipher is based on a special chart:

Each letter is a result of combining two numbers: one from across and one from down. The numbers equal the location of the letter in the chart. EXAMPLE: C – 13 (because it’s 1 across and 3 down) A – 11 (because it’s 1 across and 1 down) T – 44 (because it’s 4 across and 4 down) CAT = 13 11 44 REMEMBER! In the Polybius chart there are only letters from the English alphabet!


EXERCISE 1. Cipher these words, using the Polybius cipher: SCHOOL ………………………………………………………………………………………………………… MATHS ……………………………………………………………………………………………………….... ETWINNING ………………………………………………………………………………………………………… PROJECT ………………………………………………………………………………………………………… GREAT FUN ………………………………………………………………………………………………………… EXERCISE 2. Using the same method, cipher the proverbs given: BAD NEWS TRAVEL FAST ………………………………………………………………………………………………………… ………………………………………………………………………………………………………… ………………………………………………………………………………………………………… ……………… CURIOSITY KILLED THE CAT ………………………………………………………………………………………………………… ………………………………………………………………………………………………………… ………………………………………………………………………………………………………… CLOTHES DO NOT MAKE THE MAN ………………………………………………………………………………………………………… ………………………………………………………………………………………………………… ………………………………………………………………………………………………………… EAST OR WEST, HOME IS BEST ………………………………………………………………………………………………………… ………………………………………………………………………………………………………… ………………………………………………………………………………………………………… THE EARLY BIRD CATCHES THE WORM ………………………………………………………………………………………………………… ………………………………………………………………………………………………………… ………………………………………………………………………………………………………… TOO MANY COOKS CAN SPOIL THE BROTH ………………………………………………………………………………………………………… ………………………………………………………………………………………………………… ………………………………………………………………………………………………………… WHEN THERE IS A WILL THERE IS A WAY ................................................................................................................................................................ ................................................................................................................................................................ ................................................................................................................................................................


LESSON 3 Do you remember? - during previous lessons we learnt how to code messages with the binary system and cipher them with the Polybius cipher - to code messages with the binary system, you need two numbers: 0 and 1 and you have to know how to multiply numbers - to cipher messages with Polybius cipher, you need a special chart SUBJECT: AtBash cipher. At Bash is a simple Hebrew cipher. It was probably created around 500 B.C. The name of the cipher comes from how it works. The first letter in Hebrew alphabet is Alef, second one – Beth, last but one – Szin and the last one – Taw. AtBash means that we have to replace the first letter (Alef) with the last one (Taw) and then we replace the second letter (Beth) with the last but one (Szin). Here is the coding chart: 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 Z|Y|X|W|V|U|T|S|R|Q|P|O|N|M|L|K|J|I|H|G|F|E|D|C|B|A There is also a shortened version: A|B|C|D|E|F|G|H|I|J|K|L|M Z|Y|X|W|V|U|T|S|R|Q|P|O|N To cipher the message, you have to write A as Z, B as Y, C as X etc. Example: BLUEBERRY - YOFVYVIIB EXERCISE 1. Read the ciphered messages: Z YZW DLIPNZM YOZNVH SRH GLLOH ………………………………………………………………………………………………………… ………………………………………………………………………….. ZOO ILZWH OVZW GL OLNV ………………………………………………………………………………………………………… ………………………………………………………………………….. ZOO RH UZRI RM OLEV ZMW DZI ………………………………………………………………………………………………………… ………………………………………………………………………….. WLM’G KFG ZOO BLFI VTTH RM LMV YZHPVG ………………………………………………………………………………………………………… ………………………………………………………………………….. VEVIB COLFW SZH Z HROEVI ORMRMT ………………………………………………………………………………………………………… …………………………………………………………………………..


UIRVMWHSRK RH ORPV NLMVB – VZHRVI WLMV GSZM PVKG ………………………………………………………………………………………………………… ………………………………………………………………………… EXERCISE 2. Cipher the proverbs given: THERE IS NO SUCH THING AS A FREE LUNCH. ………………………………………………………………………………………………………… ………………………………………………………………………….. CONSTANT DROPPING WEARS AWAY A STONE. ………………………………………………………………………………………………………… ………………………………………………………………………….. ONE MAN’S MEAT IS ANOTHER MAN’S POISON. ………………………………………………………………………………………………………… ………………………………………………………………………….. NECESSITY IS THE MOTHER OF INVENTION. ………………………………………………………………………………………………………… ………………………………………………………………………….. LET SLEEPING DOGS LIE. ………………………………………………………………………………………………………… …………………………………………………………………………..


LESSON 4 Do you remember? - during the previous lessons we learnt how to use the binary system, Polybius cipher and AtBash cipher - we learnt the history of each coding and ciphering metod - we know that we need special charts with numbers and/or letters to decode hidden messages SUBJECT: Ceasar cipher. It is also called Ceasar shift. The name comes from Jules Ceasar, who probably used this metod to communicate with friends. In this cipher each letter of the original text is replaced with another one, situated in a strictly specified place. The Ceasar cipher was the basis to other, more difficult ciphers, for example Vigenere cipher. EXAMPLE: AlPHABET: CIPHER:

ABCDEFGHIJKLMNOPQRSTUVWXYZ DEFGHIJKLMNOPQRSTUVWXYZABC

THE MOVING PARAMETER is 3, because we moved the first three letters of the alphabet to the end of the cipher and we started with the fourth letter – D. HIDDEN MESSAGE = KLGGHQ PHVVDJH

EXERCISE 1. Create the cipher with the moving parameter = 5. ALPHABET: CIPHER:

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

Using the new cipher, write the proverbs given: 1. Sink or swim! ………………………………………………………………………………………………………… …………………………………. 2. Love is blind. ………………………………………………………………………………………………………… ………………………………….


3. Tomorrow never comes. ………………………………………………………………………………………………………… …………………………………. 4. It’s better to be safe than sorry. ................................................................................................................................................................ ..................................................... EXERCISE 2. This time the moving parameter = 8. ALPHABET: CIPHER:

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

Write the proverbs with the new cipher: 1. Silence is golden. ………………………………………………………………………………………………………… ………………………………… 2. Laughter is the best medicine. ………………………………………………………………………………………………………… ………………………………… 3. Rome wasn’t built in a year. ………………………………………………………………………………………………………… ………………………………… 4. The end justifies the means. ................................................................................................................................................................ .....................................................


THE LIST OF USEFUL WEBSITES Here is a website with link to some other websites that can be helpful while teaching our students elements of programming and coding: http://www.apartmenttherapy.com/20-resources-for-teaching-kids-how-to-program-code-200374 Here is a website devoted to Eva's students' favourite cartoon, Gravity falls. It's amazing, because there are the most popular and useful ciphers presented: http://gravityfalls.wikia.com/wiki/List_of_cryptograms Website http://www.makeandtakes.com/3-secret-codes-to-try-with-your-kids presents 3 ways to organise a coding game for children. They were first presented by Amy, a mother-of-three, who is interested in psychology and early childhood education. Pig Pen seems amazing! Here you can read about the most famous and useful codes and ciphers: http://listverse.com/2012/03/13/10-codes-and-ciphers/ Cryptology for kids - information and resources: https://www.cerias.purdue.edu/education/k12/teaching_resources/lessons_presentations/cryptology.html Some games based on popular characters and movies to practice block coding: https://studio.code.org