Encrypting with the recipient's public key
To send a secure message, the sender encrypts the plaintext using the receiver's public key, not their own. Only the receiver's private key can decrypt the ciphertext.
Understanding Encrypting with the recipient's public key in IGCSE Computer Science Paper 1
What it does: The key passed in is the receiver's public key, which matches the rule that the sender encrypts with the recipient's key. A public key cannot undo its own encryption. Only the matching private key, which Bella keeps secret, can decrypt the ciphertext.
Common mistakes: The sender must encrypt the plaintext, not decrypt it. Line 3 should be cipher ← encrypt(msg, key). The sender must use the receiver's public key, not their own. If they used their own key, the receiver could not decrypt it. It should be key ← receiver.publicKey.
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.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
encrypt with recipient's public keyFill in the Blanks
Spot the Error
Student with a class code? Join your class →