Keeping an encryption key secret

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Keeping an encryption key secret

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

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
2. True or false: A strong cipher is safe even if everyone knows the key.
A False
B True
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
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
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

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1send(message); send(key); AThe key is written in the same message as the ciphertext, so anyone who reads it can decrypt it.
2key = "LEMON" # told in person BShares the key in person, so it never travels with the message
3If you think the key may have leaked, change it straight away CSends the key with the message, so anyone who intercepts both can unlock it
4The key should travel by a different channel from the message DA key that may have leaked is still being used, so attackers could read new messages.
5email("Message: KHOOR. Key: shift 3") Esend_by_email(ciphertext) tell_in_person(key)
6if key_leaked: keep_using(key) Fif key_leaked: key = new_key()

Definitions

keep the key secret

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
ciphertext ← encrypt(message, key) send(__________)
2.
sendChannel ← "email" keyChannel ← "in person" shareKey(key, __________)
3.
IF keyLeaked _ TRUE THEN key ← newKey() ENDIF
4.
IF keyChannel = ___________ THEN stopSharing() ENDIF
5.
ciphertext ← encrypt(message, key) send(ciphertext) keepSecret(___)

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A msg ← "Meet at 5"
B cipher ← encrypt(msg, key)
C send(cipher + key)
Question 2
A key ← make_key()
B store(key, sticky_on_screen)
C cipher ← encrypt(msg, key)
Question 3
A if device_lost:
B new_key ← make_key()
C tell_in_person(new_key)
D keep(old_key)
Question 4
A key ← "abc"
B cipher ← encrypt(msg, key)
C send_chat(cipher)
Question 5
A if key_may_be_leaked:
B key ← keep_old_key()
C tell_in_person(key)

Answer Key

Keeping an encryption key secret
Section A: Quick Questions
Q1
A — Share it separately, such as in person
Q2
A — False
Q3
B — Change to a new key
Q4
A — Tell them in person
Q5
B — Send the key by a different channel, like a phone call
Section B: Match the Pairs
Q1
send(message); send(key); → Sends the key with the message, so anyone who intercepts both can unlock it
Q2
key = "LEMON" # told in person → Shares the key in person, so it never travels with the message
Q3
If you think the key may have leaked, change it straight away → if key_leaked: key = new_key()
Q4
The key should travel by a different channel from the message → send_by_email(ciphertext) tell_in_person(key)
Q5
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.
Q6
if key_leaked: keep_using(key) → A key that may have leaked is still being used, so attackers could read new messages.
Section C: Definitions
Q1
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.
Section D: Fill in the Blanks
Q1
ciphertext ← encrypt(message, key) send(ciphertext)
Q2
sendChannel ← "email" keyChannel ← "in person" shareKey(key, keyChannel)
Q3
IF keyLeaked = TRUE THEN key ← newKey() ENDIF
Q4
IF keyChannel = sendChannel THEN stopSharing() ENDIF
Q5
ciphertext ← encrypt(message, key) send(ciphertext) keepSecret(key)
Section E: Spot the Error
Q1
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).
Q2
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).
Q3
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).
Q4
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().
Q5
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().