GCSE · Computer Science · Edexcel · Spec 1CP2

Encryption

Imagine someone secretly copies every message you send. You can't un-copy it. So what would make that copy useless to them? That's the job of encryption.

Computer Science · Encryption

Lock it, send it, unlock it

One message, one key. Step through and watch MEET turn into nonsense and then back again.

Before you press Next, say where the letter will land after moving 3 places. Then check.

1 key = 3
2 plaintext = "MEET"
3 FOR EACH letter IN plaintext
4 add (letter moved key places FORWARD) to ciphertext
5 SEND ciphertext
6 FOR EACH letter IN ciphertext
7 add (letter moved key places BACK) to plaintext
8 OUTPUT plaintext

Variables

key=3

Output

 

Step 1: The key is 3. The sender and the receiver both know it. Nobody else should.

1 / 12

This is a Caesar cipher: every letter moves the same number of places, and that number is the key.

Step 1 of 12: The key is 3. The sender and the receiver both know it. Nobody else should..

Exam line: Encryption encodes a message so only the intended recipient can understand it. The algorithm is the set of rules for scrambling it; the key is the piece of information those rules use to lock and unlock it.
Watch out: To decrypt, move each letter BACK by the key. Moving it forward again just scrambles it a second time.

Computer Science · Breaking a cipher

Could you crack it without the key?

You've intercepted PHHW. You know it was made with a Caesar cipher, but nobody has told you the key. How many different keys could there possibly be to try?

Your estimate

50 keys

0 keys100 keys

Exam line: A Caesar cipher is easy to break because it has only 25 keys, so a simple substitution cipher like this is not strong enough to protect real-world digital data.

Predict, then check

Two tougher ciphers. A mixed alphabet cipher swaps each letter for one from a jumbled alphabet (here A→Q, B→W, K→A, O→G …). A polyalphabetic cipher keeps changing the shift (here +1, then +2, then +1, then +2).

The word BOOK is encrypted with each cipher. What happens to its two Os?

Computer Science · Symmetric and asymmetric encryption

Which key does which job?

Pick a statement, then pick the key it describes.

Still to sort

Symmetric: the shared secret key (0)

One key, used by sender and receiver

Where the line is: It's secret, like a private key, but two people have to hold it.

Asymmetric: the public key (0)

Handed out freely

Where the line is: It can lock data for the owner, but only the matching private key unlocks it.

Asymmetric: the private key (0)

Kept secret by its owner

Where the line is: It's secret, like a symmetric key, but it is never shared with anyone.

7 of 7 still to sort.

Symmetric encryption uses one shared secret key. Asymmetric encryption uses a pair of related but different keys: a public key and a private key.

Exam line: Symmetric: one key does both jobs, so both people need it. Asymmetric: the public key encrypts, and only the matching private key decrypts.
Watch out: The symmetric key and the private key are both secret. The difference is that a symmetric key is shared by two people, while a private key stays with its owner.

Computer Science · What encryption can't do

Someone copies your encrypted data. Now what?

You send your password over an encrypted connection. On its way, an attacker secretly copies (intercepts) the data.

Which is closest to what you think happens next?
How sure are you?

Exam line: Encryption protects personal and sensitive data, such as passwords, card numbers, messages and health records, by making it unreadable without the key. It greatly improves security, but it isn't foolproof.

Computer Science · Encryption in real life

Where encryption earns its keep

Describe how encryption is used to protect data in each of these: (a) a messaging app, (b) a website you visit, (c) online banking, (d) cloud storage. [4 marks]

0 words · your answer stays on this page and is not sent anywhere.

Exam line: For each application, say what gets encrypted and who that keeps it hidden from.

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

Scramble a message so only the right person can read it, and find out why the real secret is the key, not the method.

What you need to know

  • What encryption and decryption are, and the different jobs of the algorithm and the key
  • The difference between plaintext and ciphertext
  • How to encrypt and decrypt with a Caesar cipher, and why it is easy to break
  • Why mixed alphabet and polyalphabetic ciphers are harder to break
  • How symmetric and asymmetric encryption use their keys
  • How encryption protects data in everyday applications, and why it is not foolproof

The big picture

Encryption encodes data so that only the intended recipient can understand it: an algorithm uses a key to turn readable plaintext into unreadable ciphertext, and decryption uses the key to turn it back. A Caesar cipher shifts every letter by the same amount, but with only 25 keys it is easy to break by trying them all; mixed alphabet and polyalphabetic ciphers are harder to break. Symmetric encryption shares one secret key; asymmetric encryption encrypts with a public key and decrypts with a private one. Intercepted encrypted data is unreadable without the key, but weak, stolen or mismanaged keys still let attackers in.

Key points

1Encryption encodes data so that only the intended recipient can understand it. Decryption is the opposite: it turns the data back into a readable form.
2Plaintext is the original, readable data. Ciphertext is the scrambled, unreadable version.
3The algorithm is the set of rules that does the scrambling. The key is the piece of information the algorithm uses to lock or unlock the data.
4A Caesar cipher replaces each letter with the one a fixed number of places along the alphabet. That shift is the key: with +3, A becomes D. To decrypt, shift back by the same amount.
5A Caesar cipher has only 25 possible keys, so trial and error breaks it: slowly by hand, very quickly by computer.
6A mixed alphabet cipher swaps each letter for one from a rearranged alphabet. A polyalphabetic cipher changes the shift as it goes, so the same letter can be encrypted differently. Both are harder to break than a Caesar cipher.
7Symmetric encryption: one secret key, known by sender and receiver, used both to encrypt and to decrypt. Asymmetric encryption: a freely shared public key encrypts; only the owner's secret private key decrypts.
8Intercepted ciphertext is unreadable without the key, but weak, stolen or mismanaged keys still let attackers in.

Worked example

Problem

A message was encrypted with a Caesar cipher using a key of +5. The ciphertext is DJX. Decrypt it.

⚠ Watch out

Shifting forward again to decrypt. Decryption runs the key in reverse: with a key of +3, the ciphertext letter D goes back to A. Moving it forward to G just scrambles the message a second time.

🧠

Memory hook

Think of a padlock. The algorithm is how the lock works; the key is what opens it. Anyone can know how a lock works, but only the key gets you in. A Caesar cipher is a lock with just 25 possible keys, so you can simply try them all.

✓

Check yourself

Encrypt CAT with a Caesar cipher and a key of +2. Then explain, in one sentence, how someone who intercepts your ciphertext could read it without ever being told the key.

Flashcards

(15)
What is encryption?
Encoding data or a message so that only the intended recipient can understand it. It protects information from being read or tampered with by others.
What is plaintext?
The original, readable message or data, before it has been encrypted.
What is ciphertext?
The scrambled, unreadable version of the data. It can only be understood once it has been decrypted.
What is decryption?
The opposite of encryption: turning ciphertext back into readable plaintext so the intended recipient can use it.
What is a cipher (an encryption algorithm)?
The method, a set of rules, used to encrypt and decrypt data. Some ciphers are simple; more complex ones give stronger encryption.
What does the key do in encryption?
It is the piece of information the algorithm uses to lock or unlock the data. Without it, decrypting the data is extremely difficult.
How does a Caesar cipher work?
Each letter is replaced by the letter a fixed number of places along the alphabet. The shift is the key: with +3, J becomes M.
Why is a Caesar cipher easy to break?
It has only 25 possible keys, so an attacker can try them all by trial and error. A computer can do this very quickly.
What is a mixed alphabet cipher?
A cipher that replaces each letter with a letter from a rearranged alphabet.
What is a polyalphabetic cipher?
A cipher that uses a changing pattern of shifts (for example based on a keyword), so the same plaintext letter can become different ciphertext letters.
How does symmetric encryption use its key?
One secret key both encrypts and decrypts. The sender and receiver both need it, so distributing it securely is a big challenge.
In asymmetric encryption, what is the public key for?
It is freely distributed, and anyone can use it to encrypt data intended for the owner of the key pair.
In asymmetric encryption, what is the private key for?
It is kept secret by the owner and is needed to decrypt data that was encrypted with the matching public key.
If encrypted data is intercepted, what does the attacker get?
Only unreadable ciphertext, which is useless to them without the decryption key.
Is encryption foolproof?
No. It greatly improves security, but if keys are weak, stolen or mismanaged, attackers can still access the data.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More Edexcel GCSE Computer Science topics

See the full Edexcel Computer Science curriculum →

How this lesson was checked. This Edexcel GCSE Computer Science (specification 1CP2)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 1 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.