{"id":461,"date":"2026-09-20T16:45:55","date_gmt":"2026-09-20T16:45:55","guid":{"rendered":"https:\/\/ndovu.org.uk\/cs\/?p=461"},"modified":"2026-09-20T16:47:29","modified_gmt":"2026-09-20T16:47:29","slug":"yr5-term-1-1-5-codebreaker","status":"publish","type":"post","link":"https:\/\/ndovu.org.uk\/cs\/yr5-term-1-1-5-codebreaker\/","title":{"rendered":"Yr5 Term 1.1.5 Codebreaker"},"content":{"rendered":"\n<p><strong>Welcome to Year 5 Computing \u2014 Lesson 5! \ud83d\udd10<\/strong><\/p>\n<p>Today we are becoming codebreakers! We will learn how secret messages are sent across the internet using <strong>Encryption<\/strong>, and we will try to crack the classic Caesar Cipher and Random Substitution Ciphers!<\/p>\n\n<p><strong>Step 1: Keyboard Warm-up \u2328\ufe0f (10 Mins)<\/strong><\/p>\n<ul>\n  <li>Click here to warm up your fingers on our typing studio: <a href=\"https:\/\/ndovu.org.uk\/type\/\" target=\"_blank\" rel=\"noopener\">Start Typing Practice on Ndovu<\/a>.<\/li>\n  <li>Focus on correct finger placement and accuracy. Keep practicing until your teacher brings the class together!<\/li>\n<\/ul>\n\n<p><strong>Step 2: Interactive Caesar Cipher Simulator \ud83d\udd75\ufe0f\u200d\u2642\ufe0f (15 Mins)<\/strong><\/p>\n<p>A Caesar Cipher is one of the oldest encryption methods. It works by &#8220;shifting&#8221; the alphabet by a certain number. Test it out below by typing a secret message and dragging the shift slider!<\/p>\n\n<!-- Cipher Simulator & Question Module -->\n<div style=\"max-width: 850px; margin: 20px auto; font-family: Arial, sans-serif; border: 2px solid #ddd; border-radius: 10px; padding: 20px; background-color: #fcfcfc; box-shadow: 0 4px 8px rgba(0,0,0,0.05);\">\n  \n  <!-- Caesar Cipher Interactive Tool -->\n  <div style=\"background: #e6f2f8; border: 2px solid #0073aa; border-radius: 8px; padding: 15px; margin-bottom: 20px;\">\n    <h3 style=\"margin-top: 0; color: #0073aa;\">Caesar Cipher Encryptor<\/h3>\n    \n    <label style=\"font-weight: bold; font-size: 13px;\">Your Secret Message:<\/label>\n    <textarea id=\"cipher-input\" rows=\"2\" oninput=\"updateCipher()\" style=\"width: 100%; font-family: monospace; font-size: 14px; padding: 10px; margin-top: 5px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box;\" placeholder=\"Type a message here...\"><\/textarea>\n    \n    <div style=\"display: flex; align-items: center; gap: 15px; margin-bottom: 15px;\">\n      <label style=\"font-weight: bold; font-size: 13px;\">Shift Value: <span id=\"shift-display\" style=\"color: #e53935; font-size: 16px;\">3<\/span><\/label>\n      <input type=\"range\" id=\"shift-slider\" min=\"1\" max=\"25\" value=\"3\" oninput=\"updateCipher()\" style=\"flex: 1; cursor: pointer;\">\n    <\/div>\n\n    <label style=\"font-weight: bold; font-size: 13px;\">Encrypted Output (Cyphertext):<\/label>\n    <div id=\"cipher-output\" style=\"width: 100%; min-height: 40px; font-family: monospace; font-size: 16px; font-weight: bold; letter-spacing: 2px; padding: 10px; margin-top: 5px; background: #222; color: #00ffcc; border-radius: 5px; box-sizing: border-box; word-wrap: break-word;\"><\/div>\n  <\/div>\n\n  <div style=\"background: #fff; border: 1px solid #ccc; border-radius: 8px; padding: 15px; margin-bottom: 15px;\">\n    <label style=\"font-weight: bold; display: block; margin-bottom: 5px; font-size: 14px;\">1. How does a Caesar cipher work, and how do you use a &#8220;shift value&#8221; to encrypt a message?<\/label>\n    <textarea id=\"q1-caesar\" rows=\"3\" style=\"width: 100%; font-family: Arial, sans-serif; font-size: 13px; padding: 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box;\" placeholder=\"Explain how the alphabet changes...\"><\/textarea>\n  <\/div>\n\n  <div style=\"background: #fff; border: 1px solid #ccc; border-radius: 8px; padding: 15px; margin-bottom: 15px;\">\n    <label style=\"font-weight: bold; display: block; margin-bottom: 5px; font-size: 14px;\">2. How can &#8220;frequency analysis&#8221; (looking at the most common letters in a language, like &#8216;E&#8217;) help you crack a random substitution cipher?<\/label>\n    <textarea id=\"q2-frequency\" rows=\"3\" style=\"width: 100%; font-family: Arial, sans-serif; font-size: 13px; padding: 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box;\" placeholder=\"If 'X' appears the most in a secret message, what letter might it be?\"><\/textarea>\n  <\/div>\n\n  <div style=\"background: #fff; border: 1px solid #ccc; border-radius: 8px; padding: 15px; margin-bottom: 15px;\">\n    <label style=\"font-weight: bold; display: block; margin-bottom: 5px; font-size: 14px;\">3. Why is strong encryption essential for daily life on the internet (like online banking or secure messaging)?<\/label>\n    <textarea id=\"q3-importance\" rows=\"3\" style=\"width: 100%; font-family: Arial, sans-serif; font-size: 13px; padding: 10px; border: 1px solid #ccc; border-radius: 5px; box-sizing: border-box;\" placeholder=\"What would happen if our data wasn't encrypted?\"><\/textarea>\n  <\/div>\n\n  <div style=\"text-align: right;\">\n    <button type=\"button\" onclick=\"downloadCipherAnswers()\" style=\"background-color: #4CAF50; color: white; border: none; padding: 12px 25px; border-radius: 5px; cursor: pointer; font-size: 16px; font-weight: bold;\">\ud83d\udcbe Download Answers<\/button>\n  <\/div>\n<\/div>\n\n<script>\n  \/\/ Caesar Cipher Logic\n  function updateCipher() {\n    var text = document.getElementById('cipher-input').value.toUpperCase();\n    var shift = parseInt(document.getElementById('shift-slider').value);\n    document.getElementById('shift-display').innerText = shift;\n    \n    var encrypted = \"\";\n    for (var i = 0; i < text.length; i++) {\n      var charCode = text.charCodeAt(i);\n      if (charCode >= 65 && charCode <= 90) {\n        encrypted += String.fromCharCode(((charCode - 65 + shift) % 26) + 65);\n      } else {\n        encrypted += text.charAt(i); \/\/ Keep spaces and punctuation the same\n      }\n    }\n    document.getElementById('cipher-output').innerText = encrypted;\n  }\n\n  \/\/ Answer Download Logic\n  function downloadCipherAnswers() {\n    var ans1 = document.getElementById('q1-caesar').value.trim() || \"No answer provided.\";\n    var ans2 = document.getElementById('q2-frequency').value.trim() || \"No answer provided.\";\n    var ans3 = document.getElementById('q3-importance').value.trim() || \"No answer provided.\";\n\n    var textContent = \"Lesson 5: Encryption &#038; Cipher Cracking Reflection\\n\" +\n                      \"--------------------------------------------------\\n\\n\" +\n                      \"1. How does a Caesar cipher work with a shift value?\\n\" + ans1 + \"\\n\\n\" +\n                      \"2. How does frequency analysis help crack a cipher?\\n\" + ans2 + \"\\n\\n\" +\n                      \"3. Why is strong encryption essential for daily internet life?\\n\" + ans3 + \"\\n\";\n\n    var blob = new Blob([textContent], { type: 'text\/plain' });\n    var url = URL.createObjectURL(blob);\n    var a = document.createElement('a');\n    a.href = url;\n    a.download = 'Lesson5_Encryption_Reflection.txt';\n    document.body.appendChild(a);\n    a.click();\n    document.body.removeChild(a);\n    URL.revokeObjectURL(url);\n    \n    alert(\"Your answers have been downloaded! Please open the downloaded text file, copy the text, and paste it into your Computing Word document.\");\n  }\n<\/script>\n\n<p><strong>Step 3: Cracking Codes on Code.org \ud83d\ude80 (20 Mins)<\/strong><\/p>\n<p>Now that you understand how a shift cipher works, it is time to try breaking a <strong>Random Substitution Cipher<\/strong>! You will need to use your detective skills and <em>frequency analysis<\/em> to figure out which random letters match up with the real alphabet.<\/p>\n\n<div style=\"background-color: #ffebee; border-left: 5px solid #e53935; padding: 15px 20px; border-radius: 8px; margin-bottom: 20px; text-align: center;\">\n  <p style=\"margin-top: 0; font-weight: bold; font-size: 16px; color: #b71c1c;\">Mission: Launch Code.org Encryption Unit<\/p>\n  <p style=\"margin-bottom: 15px; font-size: 14px;\">Click the button below to sign in. Once signed in, navigate to your assigned Encryption section!<\/p>\n  <a href=\"https:\/\/studio.code.org\/users\/sign_in\" target=\"_blank\" rel=\"noopener\" style=\"display: inline-block; background-color: #e53935; color: white; padding: 12px 25px; border-radius: 5px; text-decoration: none; font-weight: bold; font-size: 16px;\">Launch Code.org Sign In \u2794<\/a>\n<\/div>\n\n<p><strong>Step 4: Log Off and Reflect \ud83d\udc4b (5 Mins)<\/strong><\/p>\n<ul>\n  <li><strong>Exit Ticket:<\/strong> Why are simple substitution ciphers considered weak, and why do we need much stronger encryption today?<\/li>\n  <li>Log out securely and tidy your desk space!<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to Year 5 Computing \u2014 Lesson 5! \ud83d\udd10 Today we are becoming codebreakers! We will learn how secret messages are sent across the internet&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/ndovu.org.uk\/cs\/yr5-term-1-1-5-codebreaker\/\">Continue Reading<span class=\"screen-reader-text\">Yr5 Term 1.1.5 Codebreaker<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-461","post","type-post","status-publish","format-standard","hentry","category-year5","entry"],"_links":{"self":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts\/461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/comments?post=461"}],"version-history":[{"count":2,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts\/461\/revisions"}],"predecessor-version":[{"id":463,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/posts\/461\/revisions\/463"}],"wp:attachment":[{"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/media?parent=461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/categories?post=461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndovu.org.uk\/cs\/wp-json\/wp\/v2\/tags?post=461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}