← IGCSE Computer Science Paper 1

Why a symmetric key must be shared

In symmetric encryption, the receiver can only decrypt if they hold the same key as the sender, so the key must be shared before any data is sent.

Understanding Why a symmetric key must be shared in IGCSE Computer Science Paper 1

What it does: Symmetric encryption uses one key for both encrypting and decrypting, so each side must hold an identical copy. Each pair of users needs a separate shared key, so the number of keys grows quickly as more users join (4 users need 6 keys). The receiver needs the key ready to decrypt the message as soon as it arrives, so the key is exchanged first. Without the correct shared key, the ciphertext cannot be turned back into plaintext. If someone intercepts the key while it is being shared, they can decrypt every message that uses it. The key has to be exchanged first: send(key); send(ciphertext).

Common mistakes: The receiver can only decrypt with the same shared key the sender used. "K9" is a different key, so decryption fails. It should use the key that was received: DECRYPT(cipher, key). Bob must hold exactly the same key as Alice. Giving him a different key ("K9") means he cannot decrypt her message. It should be bobKey ← aliceKey.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 189–203) and word search (Modules 189–217).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Amir encrypts a message with a symmetric key and sends it to Beth. What must Beth have to decrypt it?
The same key that Amir usedA different key that only Beth has
Matches
send(ciphertext); send(key)
↓
The key is sent after the data. The receiver cannot decrypt the message until they already have the key.
Applying
Meanings
Term
shared secret key
Meaning
In symmetric encryption, the receiver can only decrypt if they hold the same key as the sender, so the key must be shared before any data is sent.
Practice
sharedKey ← "K7"
Testing
Gaps
SEND TO Bob
Check Answer
Spots
2cipher ← RECEIVE()
3plain ← DECRYPT(cipher, "K9")

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Scorpion' badge — Venom Debugger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Amir encrypts a message with a symmetric key and sends it to Beth. What must Beth have to decrypt it?
A. A different key that only Beth has
B. The same key that Amir used ✓
Symmetric encryption uses one key for both encrypting and decrypting, so Beth needs an identical copy of Amir's key.
2. When must the symmetric key be shared with the receiver?
A. Before the encrypted data is sent ✓
B. After the receiver has got the data
The receiver needs the key ready to decrypt the message as soon as it arrives, so the key is exchanged first.
3. Which statement is true about symmetric encryption?
A. Both the sender and receiver need the key before the message is sent ✓
B. Only the sender needs the key, because the receiver can work it out
The receiver cannot work out the key from the ciphertext. Both people must already hold the key.
4. Mia receives ciphertext but does not have the shared key. What happens when she tries to decrypt it?
A. She cannot read the message ✓
B. She can decrypt it with any key she likes
Without the correct shared key, the ciphertext cannot be turned back into plaintext.
5. A class of 4 students each want a secret symmetric key with every other student. How does the number of keys change as more users join?
A. One key is enough however many users there are
B. More users need many more shared keys ✓
Each pair of users needs its own secret key. With 4 students that is 6 keys, and the number grows quickly as more users join.

Match the Pairs

send(shared_key) → The secret key is passed to the receiver first, before any encrypted data is sent.
decrypt(ciphertext, shared_key) → Only gives back the original plaintext if the receiver uses the same key the sender used to encrypt.
Both the sender and the receiver need the same key before the message is sent → sender_key = receiver_key
Many users need many shared keys: every pair of users needs its own key → keys ← n * (n - 1) / 2
send(ciphertext); send(key) → The key is sent after the data. The receiver cannot decrypt the message until they already have the key.
keys ← users → This assumes one key per user. In symmetric encryption each pair of users needs its own shared key, so many more keys are needed.

Key Term

shared secret key
In symmetric encryption, the receiver can only decrypt if they hold the same key as the sender, so the key must be shared before any data is sent.

Fill in the Blanks

1. sharedKey ← GenerateKey() SEND sharedKey TO Bob SEND Encrypt(message, sharedKey) TO Bob
Hint: Type the variable holding the secret key that must be sent to the receiver before the encrypted message.
2. IF hasKey = TRUE THEN plain ← Decrypt(cipher, key) ENDIF
Hint: Type the Boolean value that must be true before the receiver is able to decrypt.
3. IF receiverKey <> senderKey THEN OUTPUT "Cannot decrypt" ENDIF
Hint: Type the comparison operator meaning the two keys are not the same.
4. users ← 4 keys ← users * (users - 1) / 2 OUTPUT keys
Hint: Type the number of people who share each key, so no pair is counted twice.
5. key ← ReceiveKey() cipher ← ReceiveData() plain ← Decrypt(cipher, key)
Hint: Type the function name that turns the ciphertext back into plaintext using the shared key.

Spot the Error

Question 1
A key ← RECEIVE_KEY()
B cipher ← RECEIVE()
C plain ← DECRYPT(cipher, "K9")
D OUTPUT plain
Line C — The receiver can only decrypt with the same shared key the sender used. "K9" is a different key, so decryption fails. It should use the key that was received: DECRYPT(cipher, key).
Question 2
A aliceKey ← "K7"
B bobKey ← "K9"
C plain ← DECRYPT(c, bobKey)
D OUTPUT plain
Line B — Bob must hold exactly the same key as Alice. Giving him a different key ("K9") means he cannot decrypt her message. It should be bobKey ← aliceKey.
Question 3
A aliceKey ← "K7"
B bobKey ← "K7"
C IF aliceKey = bobKey THEN
D plain ← ENCRYPT(c, bobKey)
E ELSE
F OUTPUT "Cannot decrypt"
Line D — When both keys match, the receiver should DECRYPT the ciphertext to get the plaintext back. ENCRYPT would scramble it again. It should be DECRYPT(c, bobKey).
Question 4
A SEND(cipher, Bob)
B cipher ← ENCRYPT(msg, key)
C SEND(cipher, Bob)
Line A — The key must be shared before any data is sent. Here the ciphertext is sent first, and it does not even exist yet. Line 1 should be SEND_KEY(key, Bob).
Question 5
A key ← "K7"
B SEND_KEY(key, Bob)
C cipher ← ENCRYPT(msg, key)
D SEND(msg, Bob)
Line D — After the key has been shared, the sender must send the encrypted data, not the plaintext. Sending msg is insecure and does not use the key. It should be SEND(cipher, Bob).

Student with a class code? Join your class →