Unit 5.2 We are cryptographers Cracking codes 1 About this unit Software: Scratch 2.0, The Black Chamber (website) Apps: Snap!, The Black Chamber in the web browser (Safari) Hardware: Laptop/desktop computers Outcome: Morse and semaphore messages, encrypted and decrypted messages in various ciphers UNIT SUMMARY The pupils learn more about communicating information securely through an introduction to cryptography (the science of keeping communication and information secret). They investigate early methods of communicating over distances, learn about two early ciphers, and consider what makes a secure password. CURRICULUM LINKS Computing PoS Use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programs. Understand computer networks including the internet; how they can provide multiple services, such as the world wide web; and the opportunities they offer for communication and collaboration. Use technology safely, respectfully and responsibly; recognise acceptable/unacceptable behaviour; identify a range of ways to report concerns about content and contact. Suggested subject links Maths: Encryption and decryption use mathematical functions. Frequency tables play a role in cracking substitution ciphers. History: There are interesting stories involving the use of cryptography throughout history. PSHE: Privacy, safety and identity can link to topics in the school PSHE curriculum. D&T and science: The pupils could make simple electrical telegraph circuits. TRANSLATING THE COMPUTING PoS 22 Computer networks, including the internet, are not secure. To reduce the risks of this when using the internet for communication and collaboration, data is often encrypted – stored in a secret code. While these systems are complex, the pupils can gain some understanding by looking at earlier systems. These will enable the pupils to develop an understanding of how some algorithms work. The security of personal information online is often based on the use of passwords. Many web-based services now demand that passwords meet minimum complexity standards (although this provides no protection when users choose to tell others their passwords!). Keeping passwords secure is an essential aspect of using technology safely and responsibly. LEARNING EXPECTATIONS This unit will enable the children to: be familiar with semaphore and Morse code understand the need for private information to be encrypted encrypt and decrypt messages in simple ciphers appreciate the need to use complex passwords and to keep them secure have some understanding of how encryption works on the web. The assessment guidance on page 30 will help you to decide whether the children have met these expectations. VARIATIONS TO TRY The pupils could investigate the historical contexts in which cryptography and cryptanalysis have developed and been applied. The recommended resources could be replaced or supplemented by using a spreadsheet or programs in Python or Logo. The pupils could study the way in which different types of information, such as images and sounds, can be digitised by computers. 2 Getting ready THINGS TO DO Read the Core steps sections of Running the task. Decide which software/tools are most accessible/ appropriate for use with your class. Download your chosen software/tools (see Useful links) and spend some time familiarising yourself with them. Watch the Software in 60 seconds walkthrough for this unit. Think about the individuals and groups you have in your class. Could you use any of the Extensions on pages 24–29 to extend your more able children? Could you use any of the suggestions in Inclusion CD-ROM RESOURCES Software in 60 seconds – Introduction to Snap! Scratch cryptography scripts for pupils and teachers (see Steps 2–5) Semaphore reference sheet Morse code reference sheet Cipher template Unit poster – Can you crack the codes? (The answers to the codes are in Steps 1–3.) List of prime numbers Semaphore flag template Pupil self-assessment information E-SAFETY The pupils will be making use of the web throughout the unit, so the usual precautions over online access should be in place. If the pupils upload work they create for others to see, make sure precautions are in place to protect their identity, contact details and intellectual property. One of the key messages in the unit is the need for password security. The pupils should understand that they should not share passwords with anyone else. The unit also introduces the pupils to the use and importance of encrypted internet connections. Check with your network manager whether the integrity of encrypted (HTTPS) connections is observed by the school and its service provider. INCLUSION As with other programming work, aspects of this unit make considerable intellectual demands on the pupils. Some pupils may need additional (see below) to support children with specific needs, e.g. SEN or EAL? Have you considered how a Teaching Assistant will support you and the children, if one is available? Ensure you have sufficient computers/laptops/ tablets and other equipment booked in advance. If you will be going off site for this work, make the necessary arrangements. THINGS YOU NEED Two flags per pupil Torches Electrical circuit equipment (optional): light bulb, long wires, batteries and battery holder, crocodile clips, switch support and encouragement. There are language packs built in to Scratch to support pupils for whom English is a second language. The statistical properties of other languages differ from English. The unit calls for attention to detail when working with text, and some pupils might find additional support useful for this. WWW USEFUL LINKS Software and tools Scratch is free software available to use without registration: http://scratch.mit.edu. Snap! is free open source software. Use online at http://snap.berkeley.edu/snapsource/snap.html. The example scripts used in the unit are at http://scratch.mit.edu/projects/11939624 and on the CD-ROM; you and your pupils are free to modify these. A collection of cryptography function blocks for Snap! are online at http://snap.berkeley. edu/snapsource/snap.html#present:Username=mg berry&ProjectName=crypto. Simon Singh’s ‘The Black Chamber’: www.simonsingh.net/The_Black_Chamber/ chamberguide.html. Online tutorials Introduction to Scratch 2.0: http://scratch.mit.edu/ help/videos. Videos on cryptography: http://simonsingh. net/media/online-videos/cryptography/ and www.youtube.com/watch?v=EtYOXDr7u_E. Information and ideas Simon Singh has further resources available online, as well as a curated collection of links; see http://simonsingh.net/cryptography/crypto-links. Further teaching materials, produced in association with Bletchley Park’s National Code Centre: www.cimt.plymouth.ac.uk/resources/codes. 23 24 3 Running the task – We are cryptographers Software: Scratch 2.0, The Black Chamber (website) Apps: Snap!, The Black Chamber in the web browser (Safari) Hardware: Laptop/desktop computers Outcome: Morse and semaphore messages, encrypted and decrypted messages in various ciphers Core steps Step 1: Transmitting information in semaphore RESOURCES Semaphore reference sheet Unit poster reverse – Can you crack the codes? WWW Semaphore interactive worksheet: www.cimt.plymouth.ac.uk/resources/ topical/semaphore/semaphore.htm POSSIBLE OUTCOME FOR THIS STEP: Ask the pupils how people communicated over long distances before the telephone and internet were invented. What if they wanted to communicate as quickly as possible? Introduce the pupils to semaphore, in which messages are communicated by breaking them down into individual letters and sending each letter over line-of-sight distances by using a simple flag code. Give out the flags and the semaphore reference sheet, assign pupils to partners and ask them to practise sending and receiving messages in semaphore. Ask them to decode the semaphore on the unit poster. (The answer is: The smallest bone in your body is in your ear.) Ask the pupils how they might use semaphore to communicate over longer distances where the communicators cannot see each other. Prompt them to think of a sequence of semaphore signallers copying down messages and then passing them onto the next in the chain. Attempt to send at least one message like this. It’s helpful to have at least two pupils at each point in the chain; one to receive, the other to send. Note that it’s possible to pass the message on letter by letter rather than waiting for the whole message. Make connections between the way messages are transmitted using semaphore and how internet routers pass on data packets. See Step 2 from Unit 3.4 – We are network engineers. Extensions SCHOOL Encourage the pupils to learn more about semaphore signalling lines. A good place to start is http://en.wikipedia. org/wiki/Semaphore_line. HOME Ask the pupils to complete the interactive exercise on semaphore at www.cimt. plymouth.ac.uk/resources/topical/ semaphore/semaphore.htm. Step 2: Using Morse code RESOURCES Morse code reference sheet Unit poster reverse – Can you crack the codes? WWW Morse code translator: http://morsecode.scphillips.com/ jtranslator.html Letter count tool: http://scratch.mit. edu/projects/11939624/ POSSIBLE OUTCOME FOR THIS STEP: SCHOOL Assign the pupils a partner, and hand out a torch to each pair. Challenge the pupils to work out how they can use the torch to pass a message to their partner, and then compare solutions. Introduce the pupils to Morse code, explaining that this is a binary code (a code that uses only two symbols, in this case on and off), in which each letter is represented by a particular sequence of short or long pulses of light or sound, separated by gaps. Give out the Morse code reference sheet and ask the pupils to practise sending and receiving messages using Morse code over line-of-sight distances using a torch. Can they decode the Morse code message on the unit poster? (The answer is: A hippopotamus can run faster than a man.) Ask the pupils to compare Morse code to semaphore. Which did they find easier to use? Ask the pupils to suggest why some letters, such as E and T, have short codes, but others, such as Q, Y and Z, have longer codes. Explain that some letters of the alphabet are much more common in English than others, and Samuel Morse designed the code to be as efficient as possible by assigning the shortest codes to the commonest letters. Ask the pupils how Morse code could be used over longer distances. The pupils may suggest a similar receive and resend method as with semaphore. Ask them about other possibilities. Suggest that the torch could be modified, using a long cable between the switch and the bulb. Demonstrate this by connecting a light bulb to a battery and a switch via long wires. Give the pupils time to experiment with sending and receiving messages when one partner is out of sight of the other. Again, draw parallels with the internet, emphasising that on/ off electrical signals form the basis of communication at the hardware level, although the code is different from Morse’s. The pupils could create tally charts for short passages from books of their choice, to analyse how often each letter occurs, or use the letter count tool in the Scratch project at http://scratch.mit.edu/ projects/11939624/. Some pupils could become proficient at Morse using the practice machine at http://boyslife.org/games/onlinegames/575/morse-code-machine/. HOME You could ask the pupils to research the history of the electrical telegraph. A good starting point is http://en.wikipedia.org/ wiki/Electric_telegraph. 25 26 Core steps Step 3: Using the Caesar cipher to create and crack codes RESOURCES Cipher template Unit poster reverse – Can you crack the codes? WWW Scripts for pupils: http://scratch.mit. edu/projects/11939624/ Scripts for teachers: http://scratch. mit.edu/projects/18994340/ Caesar cipher tool: www.simonsingh. net/The_Black_Chamber/caesar.html POSSIBLE OUTCOME FOR THIS STEP: Ask the pupils how they might transmit a secret message using semaphore or Morse code. Explain that they could agree a cipher with their recipient in which, say, each letter of the message was shifted one place along the alphabet. So ‘hello’ would be transmitted as IFMMP. Give the pupils time to send messages to one another. Can they decode the message on the unit poster? (The answer is: The word dinosaur comes from the Greek language and means terrible lizard.) Show the pupils the encrypt script in the Scratch project (see Resources). Give them time to work out what each part of the script does. (Comments are provided on this code.) Show how the Scratch script can be changed to use a different Caesar cipher by shifting the alphabet along a different number of places. (Note that the cipher alphabet ends with a space.) Give the pupils a chance to explore the Caesar cipher tool at The Black Chamber (see Resources). Then give them a message encoded in a Caesar cipher with an unknown shift, e.g. P WXVW-FJPAXIN RDBEJIXCV TSJRPIXDC TFJXEH EJEXAH ID JHT RDBEJIPIXDCPA IWXCZXCV PCS RGTPIXKXIN ID JCSTGHIPCS PCS RWPCVT IWT LDGAS. (The message reads: ‘A high-quality computing education equips pupils to use computational thinking and creativity to understand and change the world.’ The cipher used is a shift of 15 places, from a to P, b to Q, etc.) Once a pair are successful, ask them to explain the algorithm they used to decrypt the message (e.g. repeatedly changing the number of places they shift along the alphabet by 1, and checking to see if the message makes sense). Encourage the pupils to encrypt further messages using the Caesar cipher, challenging their partner to decrypt them without knowing the key, i.e. how far along the alphabet the letters are shifted. Extensions SCHOOL Some pupils could explore the pigpen cipher at www.simonsingh.net/The_ Black_Chamber/pigpen.html. This is available as a font at www.fonts2u.com/ pigpen-regular.font. HOME The pupils might like to experiment further with encrypting and decrypting messages in Caesar ciphers with their parents, carers or siblings. Step 4: Substitution ciphers and frequency analysis RESOURCES WWW Encryption, decryption and letter count tools: http://scratch.mit.edu/ projects/11939624 www.simonsingh.net/The_Black_ Chamber/monoalphabetic.html www.simonsingh.net/The_Black_ Chamber/letterfrequencies.html www.simonsingh.net/The_Black_ Chamber/substitutioncrackingtool. html POSSIBLE OUTCOME FOR THIS STEP: Explain that the security of the Caesar cipher rests on keeping the key secret (i.e. how far along the alphabet the letters of the message are shifted) but that this is a weak encryption system as it’s easy to test all the possibilities. Brainstorm ideas for how this could be made more secure. Explain that there’s no need for the cipher alphabet to be kept in the same order. Demonstrate how to encode a message by substituting letters in the plain text alphabet for the letter in the corresponding position of a mixed-up alphabet such as EPHUBNJTGAWCSZLVQDOXYKFIRM. Start with a short phrase, e.g. ‘hello’ becomes TBCCL. Show how the Scratch scripts in http://scratch.mit. edu/projects/11939624/ can be used to create a random substitution cipher by changing the cipher alphabet to a random order. Show the pupils the equivalent tool at www. simonsingh.net/The_Black_Chamber/monoalphabetic.html. Give them time to create and use random substitution ciphers. Ask the pupils to think about the security of this system. Would it still be easy to test all the possible keys? (No, as there are very many of them.) This system can be quite easily broken, though, because some letters come up more often than others in English, as do some words. Ask the pupils to think of examples (such as the letters ‘e’, ‘t’ and ‘a’, and the words ‘the’, ‘to’, ‘and’, ‘of’ and ‘a’). Ask the pupils to look at the letter count script at http:// scratch.mit.edu/projects/11939624/ and explain how it works. Demonstrate the equivalent tool at www.simonsingh. net/The_Black_Chamber/letterfrequencies.html. Demonstrate how to use letter frequencies and common words to crack a substitution cipher, working through an example with a randomly chosen cipher text and key at www.simonsingh.net/The_Black_Chamber/ substitutioncrackingtool.html. SCHOOL Some pupils could use and crack the Vigenère cipher. See www.simonsingh. net/The_Black_Chamber/vigenere_ cipher.html and related pages. HOME The pupils could ask their parents or carers to use The Black Chamber tools to send them messages encrypted using a random substitution cipher. The pupils could then decrypt the messages using The Black Chamber’s substitution cracking tool. 27 28 Core steps Step 5: Password security RESOURCES WWW Password guessing scripts: http://scratch.mit.edu/ projects/11939624 POSSIBLE OUTCOME FOR THIS STEP: Extensions SCHOOL Ask the pupils to think about all of the web-based services they use, and ask them for which of these they have a password. Make clear that their passwords are often the only way they can prove their identity to the web server they’re using, and that if anyone else uses their password the web server will assume it’s them using it. Some pupils could explore the mathematics of password complexity, e.g. see http://en.wikipedia.org/wiki/ Password_strength, or work to improve the password-guessing script in the Scratch project. Brainstorm some of the consequences that might follow if someone else were to use their account. Emphasise how important it is that they never tell anyone their password for any web-based services. Ask the pupils to suggest some of the ways in which someone might try to persuade you to tell them a password. The pupils might like to do a role-play in which one partner tries to persuade the other to give up a (in this case fake) password. Explain that a good password shouldn’t be easy to guess, either by people or computers. Ask the pupils to experiment with the password-guessing script in http://scratch.mit.edu/ projects/11939624, starting with three-, then four- and finally five-letter passwords, noting how much longer the script takes to find their password as the length goes up. Ask them to use logical reasoning to explain how this script works. Ask the pupils to think about ways in which they could make passwords harder for people or computers to guess. Typical approaches on the web include using symbols, numbers and both upper and lower case letters. Another approach is to use much longer passphrases, made up of, say, four random words from the dictionary. Typically, these are easier to remember and harder to guess. See http://xkcd.com/936/. HOME Ask the pupils to review their passwords for any web-based services they use, and to use complex passwords where they are not already doing so. Step 6: Security on the web RESOURCES List of prime numbers Pupil self-assessment information WWW Simon Singh’s Science of Secrecy episode ‘Going Public’ (in two parts): www.youtube.com/watch?v=_ ZTWLAqYf9c and www.youtube. com/watch?v=oR0_LPbWxe4 POSSIBLE OUTCOME FOR THIS STEP: SCHOOL Explain that there’s a problem with using really good passwords on the web if they are transmitted openly between the user’s computer and the web server via the internet, as all the routers would be able to read the password. Ask the pupils to think about ways round this problem. Computer scientists have found a way around having to agree the key to code in advance. Their method is a bit like keeping the key, but sending a padlock, so that the other person can lock a message in a box and send it back to you, but only you have the key to unlock it. The maths involves using prime numbers. Give the pupils some pairs of primes to multiply, e.g. 31 × 13 or 29 × 11 (see the CD-ROM for a list of some prime numbers). This should be relatively easy. Next, ask the pupils to work out which two primes were multiplied to make, e.g. 2993; this is likely to be much more difficult (41 × 73). Watch Simon Singh’s Science of Secrecy episode, ‘Going Public’ (see Resources). Discuss the ideas in the programme. The mathematics is beyond primary level, but there’s no need for the pupils to understand the details of the algorithm. Show the pupils the difference between how http:// and https:// ages are shown in their web browser. Show them how to check the security certificates of encrypted web pages, and warn them that they should pay attention to the warning messages their browser displays if it has doubts about whether encrypted pages should be trusted. Ask the pupils to look back over the unit and to summarise what they’ve learned. Encourage them to discuss the extent to which this will affect how they use the web. Finally, the children should evaluate the success of their work. Some pupils could write a Scratch program to do prime factorisation, perhaps using lists. HOME The pupils could talk to their parents or carers about the importance of using (and checking) https:// when entering passwords and personal information. 29 4 Assessment guidance Use this page to assess the children’s computing knowledge and skills. You may wish to use these statements in conjunction with the badges provided on the CD-ROM or community site and/or with your own school policy for assessing work. BADGE ALL CHILDREN SHOULD BE ABLE TO: Send and receive messages using Morse LOGICAL THINKER 2 LOGICAL THINKER 2 COMMUNICATOR and semaphore COMMUNICATOR Encrypt and decrypt messages using the LOGICAL THINKER 2 Caesar and substitution ciphers COMMUNICATOR Recognise the importance of keeping CONTENT CREATOR 2CONTENT CREATOR 2 passwords entirely secret E-SAFETY 2 Recognise the need for encryption when LOGICAL THINKER 2 CONTENT CREATOR 2COMMUNICATOR using the web COMPUTING PoS REFERENCE PROGRAMMER 2 Understand opportunities for PROGRAMMER 2 PROBLEM SOLVER 2 PROBLEM SOLVER 2 communication Understand networks and the PROGRAMMER 2 PROBLEM SOLVER 2 opportunities they offer for communication E-SAFETY 2 E-SAFETY 2 Use technology safely and responsibly SEARCHER SEARCHER Understand how the internet can PROGRAMMER 2 PROBLEM SOLVER 2 SEARCHER provide the world wide web MOST CHILDREN WILL BE ABLE TO: Send and receive messages using Morse LOGICAL THINKER 2 LOGICAL THINKER 2 COMMUNICATOR CONTENT CREATOR 2COMMUNICATOR and semaphore beyond line-of-sight PROGRAMMER 2 E-SAFETY 2 Decrypt messages using the Caesar cipher LOGICAL THINKER 2 LOGICAL THINKER 2 COMMUNICATOR with an unknown key PROGRAMMER 2 COMMUNICATOR Understand opportunities for SOLVER 2 PROBLEM SOLVER 2 PROGRAMMER 2 PROBLEM SEARCHER communication Understand networks and the PROGRAMMER 2 PROBLEM SOLVER 2 PROBLEM SOLVER 2 opportunities they offer for communication Recognise the importance of using complex CONTENT CREATOR 2CONTENT CREATOR 2 passwords E-SAFETY 2 E-SAFETY 2 Use technology safely and responsibly SEARCHER Understand how to check if a web page is CONTENT CREATOR 2CONTENT CREATOR 2 encrypted E-SAFETY 2 E-SAFETY 2 Use technology safely and responsibly SEARCHER SEARCHER SEARCHER SOME CHILDREN WILL BE ABLE TO: Compare and contrast Morse and LOGICAL THINKER 2 semaphore with the internet Explain the algorithm for the Caesar cipherCOMMUNICATOR LOGICAL THINKER 2 Understand computer networks PROGRAMMER 2 PROBLEM SOLVER 2 including the internet COMMUNICATOR LOGICAL THINKER 2 PROGRAMMER 2 Decrypt messages using a THINKER general LOGICAL 2 LOGICAL THINKER 2 COMMUNICATOR COMMUNICATOR substitution cipher with an unknown key CONTENT CREATOR 2 using frequency analysis Understand what constitutes a complex CONTENT CREATOR 2 password E-SAFETY 2 Understand how to check the security CONTENT CREATOR 2CONTENT CREATOR 2 certificates for a web page E-SAFETY 2 PROGRAMMER 2 E-SAFETY 2 Use logical reasoning to explain how PROBLEM SOLVER 2 PROBLEM SOLVER 2 PROGRAMMER 2 some simple algorithms work COMMUNICATOR Understand networks and the PROGRAMMER 2 PROBLEM SOLVER 2 PROBLEM SOLVER 2 opportunities they offer for SEARCHER communication Use technology safely and responsibly CONTENT CREATOR 2 SEARCHER E-SAFETY 2 E-SAFETY 2 Use technology safely and responsibly SEARCHER SEARCHER PROGRESSION The following units will allow your children to develop their knowledge and skills further. Unit Unit 30 5.4 – We are web developers 6.1 – We are app planners SEARCHER 5 Classroom ideas Practical suggestions to bring this unit alive! DISPLAYS AND ACTIVITIES Morse and semaphore messages, as well as encrypted and decrypted messages using a range of ciphers, could make an interesting classroom display. Signalling in semaphore and Morse code is best done away from the computer lab, either outdoors or in the school hall. There’s scope for circle time activities around broader issues of privacy and identity. Role-play is an effective approach to exploring, and building resilience against, some of the ‘social engineering hacks’ through which malicious people attempt to obtain passwords. WWW WEBLINKS One of the US’s leading experts on cyber security: www.schneier.com/. How one brand of internet firewall provides decryption of HTTPS traffic: www.paloaltonetworks. com/resources/demos/controlling-ssl-and-ssh.html. CS Unplugged resources and links on cryptography: http://csunplugged.org/ cryptographic-protocols. This Royal Institution Christmas Lecture from 2008 includes some information about cryptography: http://richannel.org/christmas-lectures/2008/2008chris-bishop-/christmas-lectures-2008-chrisbishop--untangling-the-web. Google’s guide to online safety and security: www.google.co.uk/intl/en/goodtoknow/. The Cyber Security Challenge, sponsored by GCHQ: https://cybersecuritychallenge.org.uk/ school-competitions.php. Southampton’s National Cipher Challenge: www.cipher.maths.soton.ac.uk. Materials on cyber security for schools from the US NSA: www.nsa.gov/kids/. VISITS It’s hard to beat a trip to Bletchley Park near Milton Keynes for this unit – there are details of the education programme at www.bletchleypark.org. uk/edu/pgm.rhtm. Bletchley Park is also home to The National Museum of Computing, which is a separate organisation with its own education programme. See www.tnmoc.org/learn/educational-visits. BOOKS Gardner, M. Codes, Ciphers and Secret Writing. (Dover Publications Inc, 2003) Hodges, A. Alan Turing: The Enigma. (Vintage, 1992) Newman, D. Top Secret Code Book. (Macmillan Children’s Books, 2012) Petzold, C. Code. (Microsoft Press, 2000) Singh, S. The Code Book. (Fourth Estate, 2002) Standage, T. The Victorian Internet. (Bloomsbury Publishing, 2014) 6 Taking it further When you’ve finished, you might want to extend the project in the following ways. Cryptography and cyber security are huge topics. There’s further material that pupils could explore independently on The Black Chamber site and elsewhere. See Useful links on page 23 and Weblinks on this page for some suggestions. The cryptographic work by Alan Turing, Tommy Flowers and others at Bletchley Park in World War II was of great significance in British history and in the history of computing. The Bletchley Park website (see Weblinks) is one starting point for finding out more about this. For those in schools with NEN internet connections, www.hoc.lgfl.net provides a useful resource on the history of computing. The pupils might like to explore some of the press coverage over alleged routine monitoring by the NSA and GCHQ of internet communications, e.g. via www.theguardian.com/world/prism. Broader issues around online rights and security might be worth discussing. The US Electronic Frontier Foundation (www.eff.org) and Open Rights Group (www.openrightsgroup.org) are active pressure groups in this area. The pupils could explore steganography (the study of hiding information). 31
© Copyright 2026 Paperzz