Worksheet 4.0 (page 1 of 1) Random ciphers: using frequency analysis A random cipher is one which uses a letter to replace another letter, but does it by choosing the letters in a ‘random order’. The person encoding and the person decoding both need a list of matching letters, but anyone intercepting the message has to be very clever to work out the matching letters. One of the ways to be clever is to use frequencies of letters in the message to help try to match them to English. Activity 1. The most frequent letter in English is E. Here is a sentence without any Es. ‘Drilling for oil is boring.’ Can you invent a sentence without Es? 2. Make a frequency table from this message: When it rains why don’t sheep shrink? a k u b l v c m w d n x e o y f p z g q h r i s j t Is E the most frequent letter? In all of English the frequent letters are (in order): e t a o i n s h r. However these will possibly not be in that order in a short message – very long messages are needed (or many of them with the same cipher) to be able to match the common frequencies. 3. Try to decode this message. There are some hints below. D KRVBRYY HZ D KWL NRX D EDAW HTNDTY Which letters stand alone as words in English? Choose a match for D. What are the most common two letter words? Choose a match for H and Z. The next most common letters (R and Y) should come from the most frequent four letters: e, t, a and o. Try all the possibilities and eliminate some using unlikely spellings. The spreadsheet, Letter frequencies, is designed to calculate and graph the frequencies of the letters in any message that is typed. Compare the frequencies with those in the English language. 4. The spreadsheet, Random cipher, automatically generates a random matching of letters. It then chooses a mystery message and encodes it. Try to find the correct message. The word spaces are still there, which provides a clue. The frequency table and graph (showing the frequencies for each letter in the coded message and in English) will be helpful in trying to find the plain text message. CSF Sample Units: Years 8 to 10 Maths – Codes