Skip to the page
Year 9 · Autumn 2 · Cybersecurity

Defences, and a Caesar cipher in Python

PracticalPresent ▶

What this lesson covers

Topic 17 Cybersecurity

KS3 Computing · Cybersecurity protects computers and data. Most attacks trick people or use weak systems, so good defences cover both.

Programming Networks and Digital CommunicationCambridge Lower Secondary Computing 0860

You will learn to

  • Encrypt and decrypt a word with a Caesar cipher by hand.
  • Use ord, chr and mod 26 in Python, so a shift past Z wraps round to A.
  • Explain why a Caesar cipher is weak: there are only 25 useful keys.
  • Name four layers of defence, like 2FA, updates, a firewall and backups, and what each stops.

Success criteria

  • I can turn HELLO into KHOOR with a shift of 3, and back again.
  • I can predict that ord('A') is 65 and chr(66) is 'B'.
  • I can crack a Caesar message by trying every shift.
  • I can name four layers of defence and the attack each one stops.

Key words

Say each word, then read what it means. Every one is in the glossary too.

two-factor authentication
Logging in with two things: e.g. a password and a phone code.
Firewall
Checks network traffic and blocks what isn't allowed.
Encryption
Scrambling data so only someone with the key can read it.
Malware
Malicious software: viruses, worms, trojans, ransomware, spyware.
Phishing
Fake messages that trick people into giving details.
Brute force
Trying every possible password until one works.

The explanation

Read it here, or open the study page below to go one step at a time with things to try.

Defences

  • Strong passwords + two-factor authentication: a code on your phone too.
  • Lock-outs after 3–5 wrong tries.
  • Firewall: blocks traffic that breaks its rules.
  • Anti-malware.
  • Updates (patches): fix security holes.
  • Encryption.
  • Backups: beat ransomware.
  • Access levels: students can't edit grades.
  • Input validation: stops SQL injection.
  • Penetration testing: paid, permitted ethical hackers.
  • Physical security: locks, cameras, swipe cards.

Encryption

Encryption turns plaintext into ciphertext with a key. Only someone with the key can turn it back.

  1. Caesar cipher, key = 3: shift each letter 3 places.
  2. H → K, E → H, L → O, L → O, O → R.
  3. HELLO → KHOOR. Shift back 3 to decrypt.
!Watch out

Caesar is easy to break: only 25 possible shifts. Modern keys are hundreds of bits long (2²⁵⁶ possibilities).

Symmetric: same key locks and unlocks. Public-key: anyone locks with your public key; only your private key unlocks. HTTPS uses both.

Study it

Open the study page and go one step at a time.

The steps for this lesson

Try it

Check yourself

One question at a time. The reason shows after each answer.

Saved on this device.