A Level · Topic 17.1
A-Level Computer Science 9618 / Topic 17 / A2

Lock it with the right key.

Encryption turns readable plaintext into ciphertext that is useless to anyone without the key. At A Level you need to explain exactly which key is used at each end: one shared key, or a public and private key pair used in two different directions. Then meet quantum cryptography, which lets two parties detect an eavesdropper.

The key idea

Encryption uses an algorithm and a key to turn plaintext into ciphertext; decryption reverses it. In symmetric cryptography the same secret key encrypts and decrypts, so the key must somehow be shared safely. In asymmetric cryptography each owner has a mathematically linked public key (given to anyone) and private key (kept secret): what one key encrypts, only the other can decrypt. To send a private message to someone, encrypt with their public key. To send a verified message to the public, encrypt with your own private key. Quantum cryptography uses photons to distribute keys so that any eavesdropping is detected.

Two ways to use a key pair 1. Private message to Bank (confidentiality) plaintextciphertextplaintext Bank’spublic key Bank’sprivate key 2. Verified message from Bank (authentication) plaintextciphertextplaintext Bank’sprivate key Bank’spublic key
Fig. 1: the same key pair used two ways: the recipient's public key for privacy, the sender's private key for proof of origin
Section 01

One shared key.

In the lab, type a message and pick a key. The same shift scrambles it and unscrambles it: that is symmetric encryption. Then switch to Asymmetric to see a public and private key pair at work.

Examiner trap

"Encryption stops hackers getting the data" is wrong. The data can still be intercepted; encryption means it cannot be understood without the key.

Section 02

A key pair, two directions.

Asymmetric cryptography solves the key distribution problem. Every user or organisation generates a key pair: the public key is published, the private key never leaves its owner. Data encrypted with one key of the pair can only be decrypted with the other.

GoalSender encrypts withReceiver decrypts withWhy it works
Send a private message from the public to an individual or organisationthe recipient’s public keythe recipient’s private keyonly the recipient holds the private key, so only they can read it
Send a verified message from an organisation to the publicthe sender’s own private keythe sender’s public keyif the public key decrypts it, only the private key holder can have sent it
Worked example A toy key pair (numbers far too small for real use)
A key pair uses n = 55, public key e = 3 and private key d = 27. Encrypt the value 8 to send privately, then decrypt it.
  1. Encrypt with the recipient’s public key: ciphertext = 83 MOD 55 = 512 MOD 55.
  2. 512 = 9 × 55 + 17, so the ciphertext is 17.
  3. Decrypt with the recipient’s private key: 1727 MOD 55 = 8, the original plaintext.
  4. An interceptor who knows e = 3 and n = 55 cannot decrypt 17 without finding d, which needs the factors of n (here 5 and 11; for a real key, impossible in practice).
Answer: Ciphertext 17; decrypting with the private key gives 8
Your turn
A charity wants members of the public to send it donation details privately. Which key does a donor use to encrypt, and which key decrypts?
Examiner trap

Never say the sender encrypts a private message with their own private key. Anyone could decrypt that with the sender’s public key, so it gives authentication, not privacy.

Stage 1 · Learn

Check what the sim just showed you

Four quick checks. Each correct answer earns XP and records this skill on your profile.

Quick check+10 XP

In symmetric key cryptography, which key decrypts the ciphertext?

Quick check+10 XP

In the lab’s Asymmetric mode, which key does the sender need to encrypt a message to the receiver?

Quick check+10 XP

What is the main drawback of symmetric encryption?

Quick check+10 XP

How does quantum key distribution reveal an eavesdropper?

Section 03

Quantum cryptography.

Quantum cryptography uses the physics of light to share a secret key. The best-known method is quantum key distribution (QKD): the key is sent as a stream of single photons, each polarised to represent a 0 or a 1, along a fibre-optic cable or through free space.

Examiner trap

Quantum cryptography does not stop someone intercepting the photons. It makes interception detectable, so the compromised key is thrown away before any data is sent with it.

Stage 2 · Exam

Exam-style questions

Unlocks once the four checks above are done. Worth more XP, written to A Level Paper 3 and Paper 4 standard.

Finish the four checks above to unlock the exam questions
Exam style+20 XP

A bank sends a message to all its customers and wants them to be sure it came from the bank. How is the message encrypted?

Exam style+20 XP

Which is a drawback of quantum cryptography?

Exam style+20 XP

Why is asymmetric encryption usually used only to exchange a symmetric key, not to encrypt all the data?

Exam style+20 XP

A member of the public sends a form to a company, encrypted with the company’s public key. Who can read it?

Skill unlocked

Encryption and quantum cryptography, mastered.

This skill is now recorded on your profile. Keep the chain going.

-Rank -Level -Score -Topics
Go deeper · practice
Six original Cambridge-style questions
Plaintext and ciphertext, symmetric and asymmetric cryptography, choosing the right key for privacy or verification, and quantum cryptography.