Syllabus & Goals 3 min
Cambridge 2.3 · Symmetric and asymmetric encryption Paper 1 · Computer Systems
By the end of this lesson you can:
- Explain the purpose of encryption, using plaintext and ciphertext.
- Describe symmetric encryption and its key-distribution problem.
- Describe asymmetric encryption using a public and private key.
Recap / Warm-Up 5 min
Error checks make sure data arrives intact. Encryption makes sure that, even if data is intercepted, it can't be understood.
Quick starter
You shift every letter of CAT forward by one (C→D, A→B, T→U). What word do you send, and how does your friend read it back?
Reveal the answer
You send DBU. Your friend shifts each letter back by one to recover CAT. The shift amount is the key — and you both need it.
Key Concept 14 min
1 · The purpose of encryption
On a public network, data can be intercepted by a hacker (an eavesdropper). Encryption can't stop interception, but it makes the data unreadable to anyone without the key.
2 · Symmetric encryption
Symmetric encryption uses the same key to encrypt and to decrypt. It is fast, but both people need that one secret key.
3 · Asymmetric encryption
Asymmetric encryption solves that problem using a matching pair of keys:
- a public key — shared with everyone, used to encrypt;
- a private key — kept secret by the owner, used to decrypt.
Worked Example 12 min
(a) A simple symmetric cipher
Take the plaintext HELLO and a key of 3 (shift each letter three places forward):
| H | E | L | L | O |
|---|---|---|---|---|
| K | H | O | O | R |
Ciphertext = KHOOR. The receiver shifts each letter back by 3 (the same key) to recover HELLO.
The cipher as an algorithm
Cambridge pseudocode
// Symmetric encryption: Caesar shift on letter positions (A = 0 ... Z = 25)
DECLARE Plain : ARRAY[1:5] OF INTEGER
DECLARE Cipher : ARRAY[1:5] OF INTEGER
DECLARE Index, Key : INTEGER
Plain ← [7, 4, 11, 11, 14]
Key ← 3
FOR Index ← 1 TO 5
Cipher[Index] ← (Plain[Index] + Key) MOD 26
NEXT Index
OUTPUT "Cipher positions: ", CipherThe same idea in Python (IDLE)
# Symmetric encryption: a Caesar cipher shifts each letter by the key plain_text = "HELLO" key = 3 cipher_text = "" for letter in plain_text: shifted = (ord(letter) - ord("A") + key) % 26 cipher_text = cipher_text + chr(shifted + ord("A")) print("Cipher text is", cipher_text)
Output
Cipher text is KHOOR
Try It Yourself 12 min
Goal: Encrypt the word CODE with a symmetric shift key of 2.
Hint: C→E, O→Q…
Goal: State which key (public or private) is used to encrypt, and which to decrypt, in asymmetric encryption.
Goal: Explain why asymmetric encryption is more secure than symmetric for sending data to someone you have never met.
📝 Exam Practice 10 min
Define the term ciphertext.
Mark scheme
- Data after it has been through an encryption algorithm / encrypted (unreadable) text (1).
Explain the main security weakness of symmetric encryption.
Mark scheme
- The same key is needed by both sender and receiver (1).
- That key must be sent / shared and could be intercepted (key-distribution problem) (1).
Describe how asymmetric encryption lets Tom send Jane a confidential document.
Mark scheme
- Jane generates a public and private key pair and sends Tom her public key (1).
- Tom encrypts the document with Jane's public key and sends it (1).
- Jane decrypts it with her matching private key (which only she has) (1).
Recap & Key Terms 3 min
Encryption turns plaintext into unreadable ciphertext. Symmetric uses one shared key (fast, but the key can be intercepted). Asymmetric uses a public key to encrypt and a secret private key to decrypt. That completes Unit 2 — Data transmission.
- Plaintext / ciphertext
- The readable original data / the scrambled encrypted output.
- Symmetric encryption
- Encryption that uses the same key to encrypt and decrypt.
- Asymmetric encryption
- Encryption using a public key (to encrypt) and a matching private key (to decrypt).
- Public / private key
- A mathematically linked pair; the public key is shared, the private key is kept secret.
Homework 1 min
Task (≤ 15 min): (a) Encrypt SECURE with a symmetric shift key of 4. (b) State one advantage of asymmetric over symmetric encryption.
Model answer
- (a) S→W, E→I, C→G, U→Y, R→V, E→I → WIGYVI.
- (b) The decryption (private) key never has to be shared, so it can't be intercepted.