← ACARA Digital Technologies Years 7–8

Keeping an encryption key secret

Encryption is only as strong as its key. Never send the key with the message, share it in person or by another channel, and change it if it may have leaked.

Understanding Keeping an encryption key secret in ACARA Digital Technologies Years 7–8

What it does: Changing a leaked key means the old key no longer unlocks new messages, which restores the protection. Using a separate channel for the key means an interceptor of the message does not also get the key. If the key travels with the message, anyone who intercepts it can unlock it. Share the key in person or by another channel. Encryption is only as strong as its key. If the key is known, anyone can decrypt the message. A group chat can be seen by others and the key could leak. Sharing in person keeps it secret. Without the key, ciphertext is just scrambled text. This is why the key must stay secret.

Common mistakes: The key must never travel with the message. Anyone who intercepts it could decrypt the message straight away. Send only the cipher: send(cipher). A key on a sticky note on the screen is not secret, because anyone can see it. It should be stored somewhere safe, such as store(key, locked_vault).

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 696–726) and word search (Modules 696–770).

Take this worksheet further — free with Cloodit

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

Learning
Duo
Maya sends a locked message to Sam. Where should she put the key?
Share it separately, such as in personAttach it to the same message
Matches
email("Message: KHOOR. Key: shift 3")
↓
The key is written in the same message as the ciphertext, so anyone who reads it can decrypt it.
Applying
Meanings
Term
keep the key secret
Meaning
Encryption is only as strong as its key. Never send the key with the message, share it in person or by another channel, and change it if it may have leaked.
Practice
SEND encrypted message BY email
Testing
Gaps
send()
Check Answer
Spots
2cipher ← encrypt(msg, key)
3send(cipher + key)

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

The 'Parrotfish' badge — Function Builder, 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. Maya sends a locked message to Sam. Where should she put the key?
A. Share it separately, such as in person ✓
B. Attach it to the same message
If the key travels with the message, anyone who intercepts it can unlock it. Share the key in person or by another channel.
2. True or false: A strong cipher is safe even if everyone knows the key.
A. False ✓
B. True
Encryption is only as strong as its key. If the key is known, anyone can decrypt the message.
3. Jai thinks his secret key may have leaked. What should he do?
A. Keep using the same key
B. Change to a new key ✓
A leaked key can no longer protect messages. Switch to a new key and share it safely.
4. Which is a safer way to give a friend your encryption key?
A. Tell them in person ✓
B. Post it in the group chat
A group chat can be seen by others and the key could leak. Sharing in person keeps it secret.
5. Lena emails a coded message. Which is the safer plan for the key?
A. Put the key in the email after the message
B. Send the key by a different channel, like a phone call ✓
Using another channel means an interceptor of the email still does not get the key.

Match the Pairs

send(message); send(key); → Sends the key with the message, so anyone who intercepts both can unlock it
key = "LEMON" # told in person → Shares the key in person, so it never travels with the message
If you think the key may have leaked, change it straight away → if key_leaked: key = new_key()
The key should travel by a different channel from the message → send_by_email(ciphertext) tell_in_person(key)
email("Message: KHOOR. Key: shift 3") → The key is written in the same message as the ciphertext, so anyone who reads it can decrypt it.
if key_leaked: keep_using(key) → A key that may have leaked is still being used, so attackers could read new messages.

Key Term

keep the key secret
Encryption is only as strong as its key. Never send the key with the message, share it in person or by another channel, and change it if it may have leaked.

Fill in the Blanks

1. ciphertext ← encrypt(message, key) send(ciphertext)
Hint: Type the variable holding the scrambled message that is safe to send. The key is never sent with it.
2. sendChannel ← "email" keyChannel ← "in person" shareKey(key, keyChannel)
Hint: Type the variable for the separate channel used to share the key, not the one that carries the message.
3. IF keyLeaked = TRUE THEN key ← newKey() ENDIF
Hint: Type the operator that checks whether the key may have leaked, so it can be changed.
4. IF keyChannel = sendChannel THEN stopSharing() ENDIF
Hint: Type the variable for the channel that carries the message. Sharing the key on it too is unsafe, so sharing stops.
5. ciphertext ← encrypt(message, key) send(ciphertext) keepSecret(key)
Hint: Type the variable for the one item that must be kept secret so the encryption stays strong.

Spot the Error

Question 1
A msg ← "Meet at 5"
B cipher ← encrypt(msg, key)
C send(cipher + key)
Line C — The key must never travel with the message. Anyone who intercepts it could decrypt the message straight away. Send only the cipher: send(cipher).
Question 2
A key ← make_key()
B store(key, sticky_on_screen)
C cipher ← encrypt(msg, key)
Line B — A key on a sticky note on the screen is not secret, because anyone can see it. It should be stored somewhere safe, such as store(key, locked_vault).
Question 3
A if device_lost:
B new_key ← make_key()
C tell_in_person(new_key)
D keep(old_key)
Line D — A key that may have leaked must be replaced and the old one removed. Keeping the old key lets attackers still read messages. It should be delete(old_key).
Question 4
A key ← "abc"
B cipher ← encrypt(msg, key)
C send_chat(cipher)
Line A — A short, simple key is easy to guess, so the encryption is weak. The key should be hard to guess, such as key ← random_key().
Question 5
A if key_may_be_leaked:
B key ← keep_old_key()
C tell_in_person(key)
Line B — If the key may have leaked, it must be changed. Keeping the old key means attackers can still use it. It should be key ← make_new_key().

Student with a class code? Join your class →