The answersDownload the PDF
Worksheet

F11.6 Encryption

Cyber security · GCSE · OCR J277 1.4.2, AQA 8525 3.6.3, Edexcel 1CP2 5.3.2 · about 20 min

BugBotLab
NameClassDate

What this lesson is about

Plaintext, keys and ciphertext, the Caesar cipher, symmetric and asymmetric, and a secret over the radio.

Questions 6 marks in all

  1. [1 mark]What is encryption?

    1. AScrambling data so only someone with the key can read it
    2. BMaking data smaller
    3. CDeleting data safely
    4. DCopying data to another place
  2. [1 mark]Encrypt HELLO with a Caesar cipher, key 1.

  3. [1 mark]Why is the Caesar cipher easy to break?

    1. AThere are only 25 possible keys to try
    2. BIt uses no key
    3. CIt cannot be decrypted
    4. DIt only works on numbers
  4. [1 mark]In asymmetric encryption, what can be shared openly?

    1. AThe public key
    2. BThe private key
    3. CThe plaintext
    4. DBoth keys
  5. [1 mark]What does the padlock and https in a browser mean?

    1. AThe connection is encrypted
    2. BThe site is free
    3. CThe site is fast
    4. DThe site has no adverts
  6. [1 mark]What does this program print?

    def caesar(t, k):
        return ''.join(chr((ord(c) - 65 + k) % 26 + 65) for c in t)
    print(caesar('ABC', 2))

The task: send a secret

Write caesar(text, key) that shifts letters by the key and leaves anything else unchanged. Using a key of 7, encrypt message, print sending: <ciphertext>, and send the ciphertext by radio. The Ally replies with its own encrypted message; decrypt each reply and print reply means: <plaintext>. You should read the Ally saying ALL CLEAR.

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

message = "MEET AT BASE"

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/f11-6-encryption/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Break a Caesar cipher: given only the ciphertext, print all 25 possible decryptions and pick the one that reads as English.
  2. Why is a shift of 13 special? Encrypt a message twice with key 13.
  3. Explain why the public key can be shared openly without helping an attacker.