← IGCSE Computer Science Paper 1

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.

Understanding Private key in IGCSE Computer Science Paper 1

What it does: Only the public key is shared. The private key is never sent over the network, which keeps it safe from interceptors. The owner uses the private key to decrypt messages that were encrypted with their public key. Whoever holds the private key can decrypt the data. If it is stolen, the protection is lost.

Common mistakes: 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. 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.

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 204–217) 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
Who should have access to a private key?
Only the owner of the key pairAnyone who wants to send a message
Matches
email(friend, private_key)
↓
The private key must never be sent to anyone. Share the public key instead.
Applying
Meanings
Term
private key
Meaning
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.
Practice
ciphertext ← RECEIVE()
Testing
Gaps
plaintext = (ciphertext, privateKey)
Check Answer
Spots
2publicKey ← keys.public
3privateKey ← keys.public

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

The 'Blue-Ringed Octopus' badge — Reef Legend, 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. Who should have access to a private key?
A. Anyone who wants to send a message
B. Only the owner of the key pair ✓
The private key is kept secret by its owner. It is the public key that is shared with other people.
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
The owner uses the private key to decrypt messages that were encrypted with their public key.
3. Alex wants to send Priya a secure message. Which key does Priya send to Alex?
A. Her public key ✓
B. Her private key
Priya only ever shares her public key. Her private key is never sent to anyone, not even the sender.
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 ✓
If the private key travelled across a network it could be intercepted, so it stays with the owner.
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
The public key is shared widely, but only the private key can decrypt data encrypted with it. So only Sam can read the message.

Match the Pairs

private key → The secret half of a key pair that only the owner keeps and uses to decrypt data
decrypt(message, private_key) → Turns ciphertext back into plaintext using the owner's secret key
The private key is never sent to anyone, so it stays only on the owner's device → send(public_key) # private_key stays secret
Only the owner can decrypt a message that was encrypted with their public key → plaintext = decrypt(ciphertext, my_private_key)
email(friend, private_key) → The private key must never be sent to anyone. Share the public key instead.
decrypt(ciphertext, public_key) → Decryption needs the owner's private key, not the public key, which anyone can have.

Key Term

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.

Fill in the Blanks

1. plaintext = DECRYPT(ciphertext, privateKey)
Hint: Type the function name that turns ciphertext back into plaintext using the private key.
2. ciphertext = ENCRYPT(message, publicKey)
Hint: Type the variable for the other half of the key pair, the one the sender uses to encrypt. It can be shared openly.
3. IF user = owner THEN text = DECRYPT(data, privateKey) ENDIF
Hint: Type the value for the only person who is able to decrypt with this key.
4. IF privateKeyStolen THEN securityLost = TRUE ENDIF
Hint: Type the variable name that records the secret half of the key pair falling into the wrong hands.
5. keepSecret(privateKey)
Hint: Type the name of the key that the owner must never send to anyone.

Spot the Error

Question 1
A keys ← GenerateKeyPair()
B publicKey ← keys.public
C privateKey ← keys.public
D SEND(publicKey, Ben)
Line 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.
Question 2
A cipher ← RECEIVE()
B key ← myPrivateKey
C text ← DECRYPT(cipher, key)
D OUTPUT cipher
Line 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.
Question 3
A keys ← GenerateKeyPair()
B SEND(keys.private, Ben)
C KEEP(keys.private)
Line B — A private key is never sent to anyone. Only the public key can be shared. It should be SEND(keys.public, Ben).
Question 4
A key ← owner.publicKey
B text ← DECRYPT(cipher, key)
C OUTPUT text
Line 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.
Question 5
A stolen ← TRUE
B secure ← TRUE
C IF stolen = TRUE THEN
D secure ← TRUE
E ENDIF
Line 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.

Student with a class code? Join your class →