Single lesson · Key Stage 3

Encryption: a Caesar cipher in Python – Year 9 Computing lesson

Pupils learn to encrypt and decrypt with a Caesar cipher by hand and write a Python function that encrypts a message with a given key.

Also in a bundle Cyber Security – Year 9 Computing lessons 6 lessons for £20 · save 16% on buying separately

Lesson 5 of 6 in unit 9.3 Cyber Security, taught in Year 9, Spring 1. It answers one big question: How does encryption keep a message confidential?

By the end, pupils can encrypt and decrypt with a Caesar cipher by hand and write a Python function that encrypts a message with a given key.

The Build (the main task)
Write a Python function encrypt(message, key) that uses a Caesar cipher to encrypt a message in capital letters, wrapping round from Z to A, then call it.
Support version
Parsons problem: the function's lines are jumbled, with one extra line that leaves out the wrap-round (% 26).
Challenge
Write decrypt(message, key), then explain why a Caesar cipher is too weak for real customer data.
Real-world link
Riverside Bike Fix sends customer details to its card company; today pupils see how encryption keeps them confidential and code the oldest cipher.
Key words
Encryption, Cipher and Confidential, each with a definition, an icon and a common mix-up on the key vocabulary slide.
Misconceptions it tackles
“Shifting a letter near the end of the alphabet goes off the end, so the cipher breaks”; “Encryption stops data from being intercepted”.
National Curriculum
NC9 (use technology safely, respectfully, responsibly and securely; report concerns); NC5 (hardware and software components and how they communicate with each other and other systems).

Every lesson follows the same Code & Commerce structure: a Bell Task recall starter, key vocabulary with definitions and icons, short teaching chunks with a check before pupils move on, The Build (one main task), challenge questions that get harder, and an exit question. Answers reveal one at a time on the slides, and everything is editable PowerPoint and Word.

Pupils need computers for the main task.

Also sold in the Cyber Security unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.

What's included

  • Slide deck (PowerPoint)
  • Lesson plan (Word)
  • Worksheet (Word)
  • Support worksheet with scaffolds (Word)
  • Encryption - a Caesar cipher in Python - Quiz Quiz Trade Cards
  • Single-teacher licence: use and adapt it with your own classes

More for KS3 Computing

See all

Written for the specifications named. Not endorsed by or affiliated with any exam board.