Private key

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

Private key

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Who should have access to a private key?
A Anyone who wants to send a message
B Only the owner of the key pair
2. What is a private key used for in asymmetric encryption?
A Decrypting data that was encrypted with the matching public key
B Encrypting data so that anyone can read it
3. Alex wants to send Priya a secure message. Which key does Priya send to Alex?
A Her public key
B Her private key
4. Which statement about a private key is correct?
A It is sent with every message so the receiver can decrypt it
B It is never sent to anyone
5. A message was encrypted with Sam's public key. Who can decrypt it?
A Only Sam, using his private key
B Anyone who has Sam's public key

Match the Pairs

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

Left columnRight column
1private key ADecryption needs the owner's private key, not the public key, which anyone can have.
2decrypt(message, private_key) BThe private key must never be sent to anyone. Share the public key instead.
3The private key is never sent to anyone, so it stays only on the owner's device CThe secret half of a key pair that only the owner keeps and uses to decrypt data
4Only the owner can decrypt a message that was encrypted with their public key DTurns ciphertext back into plaintext using the owner's secret key
5email(friend, private_key) Esend(public_key) # private_key stays secret
6decrypt(ciphertext, public_key) Fplaintext = decrypt(ciphertext, my_private_key)

Definitions

private key

Fill in the Blanks

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

1.
plaintext = _______(ciphertext, privateKey)
2.
ciphertext = ENCRYPT(message, _________)
3.
IF user = _____ THEN text = DECRYPT(data, privateKey) ENDIF
4.
IF ________________ THEN securityLost = TRUE ENDIF
5.
keepSecret(__________)

Spot the Error

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

Question 1
A keys ← GenerateKeyPair()
B publicKey ← keys.public
C privateKey ← keys.public
D SEND(publicKey, Ben)
Question 2
A cipher ← RECEIVE()
B key ← myPrivateKey
C text ← DECRYPT(cipher, key)
D OUTPUT cipher
Question 3
A keys ← GenerateKeyPair()
B SEND(keys.private, Ben)
C KEEP(keys.private)
Question 4
A key ← owner.publicKey
B text ← DECRYPT(cipher, key)
C OUTPUT text
Question 5
A stolen ← TRUE
B secure ← TRUE
C IF stolen = TRUE THEN
D secure ← TRUE
E ENDIF

Answer Key

Private key
Section A: Quick Questions
Q1
B — Only the owner of the key pair
Q2
A — Decrypting data that was encrypted with the matching public key
Q3
A — Her public key
Q4
B — It is never sent to anyone
Q5
A — Only Sam, using his private key
Section B: Match the Pairs
Q1
private key → The secret half of a key pair that only the owner keeps and uses to decrypt data
Q2
decrypt(message, private_key) → Turns ciphertext back into plaintext using the owner's secret key
Q3
The private key is never sent to anyone, so it stays only on the owner's device → send(public_key) # private_key stays secret
Q4
Only the owner can decrypt a message that was encrypted with their public key → plaintext = decrypt(ciphertext, my_private_key)
Q5
email(friend, private_key) → The private key must never be sent to anyone. Share the public key instead.
Q6
decrypt(ciphertext, public_key) → Decryption needs the owner's private key, not the public key, which anyone can have.
Section C: Definitions
Q1
private key — The secret half of a key pair. Only the owner keeps it, never sends it, and uses it to decrypt data that was encrypted with their public key.
Section D: Fill in the Blanks
Q1
plaintext = DECRYPT(ciphertext, privateKey)
Q2
ciphertext = ENCRYPT(message, publicKey)
Q3
IF user = owner THEN text = DECRYPT(data, privateKey) ENDIF
Q4
IF privateKeyStolen THEN securityLost = TRUE ENDIF
Q5
keepSecret(privateKey)
Section E: Spot the Error
Q1
C — The private key must be taken from keys.private. Here the variable privateKey is given the public half of the pair, so it is not a private key at all. It should be privateKey ← keys.private.
Q2
D — The private key is used to decrypt the ciphertext into plaintext, which is stored in text. Outputting cipher shows unreadable ciphertext. It should be OUTPUT text.
Q3
B — A private key is never sent to anyone. Only the public key can be shared. It should be SEND(keys.public, Ben).
Q4
A — Data encrypted with the owner's public key is decrypted with the owner's private key. The public key cannot decrypt it. It should be key ← owner.privateKey.
Q5
D — If the private key is stolen, the security is lost, because anyone holding it can decrypt the data. The line should set secure ← FALSE.