Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

Encryption and hashing

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

50 minutes

A secret note in class

You want to pass a secret note, but the teacher may catch it. So you change each letter to the next one in the alphabet.

HELLO becomes IFMMP. Your friend knows the trick, so she can read it. The teacher cannot.

Computers do the same, with much better tricks.

Key words

WordWhat it meansExample
EncryptionScrambling data so only someone with the right key can read it.HELLO becomes IFMMP
DecryptionTurning scrambled data back into readable data.IFMMP becomes HELLO
AlgorithmA set of steps that a computer follows.the steps that scramble a message
KeyA secret value used to scramble or unscramble data.shift by 1
PlaintextThe message before it is scrambled.HELLO
CiphertextThe scrambled message.IFMMP
SymmetricEncryption that uses one key for both locking and unlocking.one house key
AsymmetricEncryption that uses two keys: a public key and a private key.a postbox
HashingTurning data into a short fixed code that cannot be turned back.a fingerprint of a file

The cells students fill in are left blank in this preview.

Quick check: which word?

Have a go

Quick check: which word?

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Extra: Worked example: shift by 3

Plain letterCount 3 steps on, naming each letterCipher letter
AA, B, C, DD
BB, C, D, EE
XX, Y, Z, A (wrap round)A
H E L L OShift each letter by 3K H O O R

The cells students fill in are left blank in this preview.

Extra: Try it: shift the letters

Code: python
message = "HELLO"
key = 3
secret = ""

for letter in message:
    place = ord(letter) - ord("A")
    place = (place + key) % 26
    secret = secret + chr(place + ord("A"))

print(secret)

# Change the key to 1. You should see IFMMP.

This shift is only a toy

data-callouts.warning.label

Anyone can break a shift cipher in a few minutes, by trying all 25 keys. Real systems use much stronger methods, with keys that are very long.

The lesson goes on

10 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.