Library Computer Science 0478 Encryption
O Level · Computer Science 0478

Encryption

Revise Encryption for Computer Science 0478 (O Level) — revision notes and instant AI marking. Free to start.

📖 Revision notes · preview
Cambridge IGCSE (0478) · Computer Science

Encryption

Big idea: Encryption scrambles readable data (plaintext) into unreadable data (ciphertext) using a key, so that even if someone intercepts it, they can't understand it without the correct key to unlock it again.

Summary — What This Chapter Covers

  • What encryption is and why it's needed, especially on wireless networks
  • How wireless networks create and use a "master key" from the SSID + password
  • How wired networks handle encryption differently (left to individual apps, e.g. HTTPS)
  • The difference between plaintext and ciphertext
  • Symmetric encryption — one shared secret key for both encrypting and decrypting
  • Asymmetric encryption — a public key and a private key working as a pair
  • Why large keys make encryption almost impossible to crack by guessing

1. What Is Encryption?

Think about sending a postcard versus sending a sealed letter. A postcard can be read by literally anyone who handles it along the way — the postman, anyone who picks it up if it falls, anyone at all. A sealed letter, on the other hand, only makes sense to the person who's allowed to open it.

Data travelling across a network is like a postcard by default — anyone who intercepts it can read it. Encryption is the process of scrambling that data into a meaningless jumble before it's sent, so that even if it's intercepted, it's useless without the key to unscramble it.

Core Rule Encryption = scrambling data before transmission, so it makes no sense to anyone without the correct key.

You might wonder: if encryption matters on any network, why do your notes single out wireless networks as needing it "more"? Here's the reasoning: on a wired network, data travels down a physical cable — to intercept it, someone would need to physically tap into that cable, which is difficult and risky. On a wireless network, data is broadcast through the air as radio waves in all directions. Anyone with the right equipment sitting nearby — in a car outside your house, in the next office, even in the flat next door — can pick up those radio waves without ever touching a cable. That's what makes interception so much easier on wireless networks, and why strong encryption is critical there.

Quick Analogy
A wired network is like a private phone line running through a locked pipe underground — hard to tap. A wireless network is like shouting your conversation across a room — anyone nearby with working ears (or a radio receiver) can pick it up. Encryption is what turns that shouted conversation into a language only the intended listener understands.
Practice Question 1 Explain why encryption is considered more critical on a wireless network than on a wired network. (2 marks)

2. How Is Wireless Data Encrypted?

The Master Key

Every wireless network has an SSID (Service Set Identifier) — that's just the network's name, the one you see in your list of available Wi-Fi networks. When you connect to a network, you enter the SSID (by picking it from the list) along with the network's password. Your device combines these two things to generate something called the master key.

Here's the crucial part: every device that connects using the same SSID and password gets an identical copy of that master key. It's not sent across the network as a separate message — each device independently calculates the same key from the same inputs (SSID + password), the same way two people following the same recipe end up with the same dish without ever showing each other the finished product.

ROUTER DEVICE ┌─────────────┐ ┌─────────────┐ │ SSID + PASS │ ──► generates key ──► │ SSID + PASS │ ──► generates key └─────────────┘ └─────────────┘ │ │ ▼ ▼ MASTER KEY ═══════ (identical) ═══════ MASTER KEY Data is encrypted with the master key BEFORE it is sent. The master key ITSELF is never transmitted.
Core Rule The master key is used to encrypt plaintext into ciphertext before sending, and the receiver uses that same master key to decrypt the ciphertext back into plaintext. The key itself never travels across the network.

Why does that last point matter so much? Because if the master key were ever transmitted, a hacker intercepting the network traffic could simply grab it and use it to decrypt everything else. Since it's never sent, an intercepted stream of ciphertext is just useless noise to anyone who doesn't already possess the key.

Protocol Name-Drop
Wireless networks use dedicated security protocols — the one you need to know is WPA2 (Wi-Fi Protected Access 2) — built specifically to manage this master-key encryption process for Wi-Fi.
Practice Question 2 A student says: "The master key is sent from the router to the device when it connects, so that both sides have the same key." Explain why this statement is incorrect. (2 marks)

3. How Is Wired Data Encrypted?

Wired networks are encrypted using the same basic principle as wireless ones — a master key is used to encrypt data, and the same key is used to decrypt it. So the underlying mechanism (a shared key scrambling and unscrambling data) doesn't change.

What does change is who decides to use encryption and how. On a wireless network, encryption is essentially baked into the connection itself via the SSID/password/protocol (like WPA2) — it's automatic. On a wired network, there's no equivalent "automatic" layer forcing encryption on all data. Instead, it's left to individual applications to decide whether and how to encrypt their own data.

The classic example you need to know is HTTPS (HyperText Transfer Protocol Secure) — the padlock icon you see in your browser's address bar. A website using HTTPS is an application-level decision to encrypt the data flowing between your browser and that website's server, even though the underlying wired (or wireless) network connection itself doesn't force this to happen.

Common Mix-Up
Don't assume "wired = automatically encrypted" or "wireless = automatically insecure." Both types of network can be encrypted — the difference this chapter wants you to know is where the responsibility for encryption sits: built into the network connection (wireless, via protocols like WPA2) versus left up to each individual application (wired, e.g. HTTPS).
Practice Question 3 State one similarity and one difference between how wired and wireless networks handle encryption. (2 marks)

4. Keys, Plaintext & Ciphertext

Before we can properly compare symmetric and asymmetric encryption, you need three vocabulary pieces locked down cold, because examiners will test whether you use them precisely.

Plaintext The original, readable data before it has been encrypted. This is what you want to protect.
Ciphertext The scrambled, unreadable data after encryption has been applied. This is what actually gets transmitted across the network.
Key A binary string of a certain length that, when fed into an encryption algorithm along with the plaintext, produces the ciphertext (and vice versa for decryption). Think of it like a password that the algorithm uses to scramble/unscramble the data.
Algorithm The mathematical procedure/formula that actually does the scrambling, using the key as an input. The key and algorithm work together — the algorithm is the "recipe," the key is the specific "ingredient" that makes your output unique to you.
Core Rule Plaintext + Key + Algorithm → Ciphertext (encryption). Ciphertext + Key + Algorithm → Plaintext (decryption).

One thing that trips students up: keys can vary hugely in size, and they function a lot like passwords — the person (or algorithm) that holds the correct key is the only one who can unlock the data. A longer key isn't just "a bit better" — it's exponentially harder to guess, which we'll come back to below.

5. Symmetric Encryption

One Key, Shared by Both Sides

Symmetric encryption is when both the sender and the receiver are given an identical secret key, and that one single key is used both to encrypt the plaintext and to decrypt the ciphertext. It's called "symmetric" because both operations (locking and unlocking) use exactly the same key — like a single physical key that both locks and unlocks the same padlock.

SENDER RECEIVER plaintext ──[SECRET KEY]──► ciphertext ──► ciphertext ──[SECRET KEY]──► plaintext (encrypt) (decrypt) Same key used on BOTH sides.

The obvious weakness here: if a hacker ever gains access to that secret key, they can decrypt any intercepted data — game over, the whole system is compromised. This creates a real practical problem: how do you get the secret key safely to the other person in the first place, without sending it over the same network you're trying to protect (since that network isn't secure yet)?

Your notes give three real ways this "key distribution problem" gets solved:

  • Verbally, in person — the two parties simply meet and tell each other the key directly.
  • Standard postage mail — writing the key down and sending it the old-fashioned way, physically, rather than electronically.
  • An algorithm calculating the key — both parties exchange some secret non-key information (not the key itself), and each side runs the same algorithm on that shared information to independently arrive at the identical key — this is essentially the same trick the wireless master key uses (SSID + password → same key on both ends, without sending the key itself).
Why This Matters
Symmetric encryption is fast and efficient — but it's only as secure as the secrecy of that one shared key. Lose the key, lose everything.
Practice Question 4 Describe what is meant by symmetric encryption. (2 marks)

6. Asymmetric Encryption

Two Keys: Public and Private

Asymmetric encryption solves the key-distribution headache above by using two different keys that work as a pair:

  • Public key — known to everyone. You can hand this out freely, publish it, put it on a website — it doesn't need to be kept secret.
  • Private key — known only to the receiver. This one is never shared with anyone.

Both keys are needed to complete the full encrypt-then-decrypt process, but crucially, they're used by different people at different stages:

PERSON A (sender) PERSON B (receiver) owns a PUBLIC key + PRIVATE key message ──[B's PUBLIC key]──► ciphertext ──► sent over network/internet │ ▼ plaintext ◄──[B's PRIVATE key]── ciphertext (only B can do this)

Step by step, using your notes' exact process:

  1. Person A uses Person B's public key to encrypt their message.
  2. Person A sends the resulting ciphertext over the network or internet.
  3. Person B decrypts the message using their own secret private key.
Core Rule Only one private key can decrypt the message, and — unlike a symmetric key — the private key is never sent over the internet. It stays with its owner the entire time.

This is the elegant part: because anyone can grab Person B's public key and use it to encrypt a message for them, there's no awkward "how do we secretly swap a key first" problem like there is with symmetric encryption. Only Person B's private key — which never leaves Person B — can undo the encryption. Even if a hacker intercepts the ciphertext and knows the public key, they still can't decrypt it, because encrypting and decrypting require different keys here.

Analogy
Imagine Person B hands out open padlocks (the public key) to anyone who wants one, but keeps the only key that opens them (the private key) locked away. Anyone can snap one of B's padlocks shut on a box (encrypt a message) — but only B, with their one private key, can ever open it again.

Why Large Keys Matter

Keys aren't small — they're long binary strings, and the number of possible combinations grows explosively as key length increases. Your notes give a striking example: a key using just 100 bits generates 1,267,650,600,228,229,401,496,703,205,376 different possible combinations. That's over 1.2 nonillion possibilities — a number so large that even the fastest computers imaginable would take longer than the age of the universe to try every combination by brute force. This is exactly why large keys are described as near impossible for a hacker to guess.

Practice Question 5 Person A wants to send Person B a confidential message using asymmetric encryption. Describe the steps involved, and explain why this method is more secure against key interception than symmetric encryption. (4 marks)

7. Symmetric vs Asymmetric — Side by Side

Feature Symmetric Encryption Asymmetric Encryption
Number of keys One (shared secret key) Two (public + private key pair)
Who holds the key(s) Both sender and receiver hold an identical copy Everyone can hold the public key; only the receiver holds the private key
Key used to encrypt The shared secret key The receiver's public key
Key used to decrypt The same shared secret key The receiver's private key only
Main risk If the secret key is intercepted, all data can be decrypted Much harder to compromise, since the private key is never transmitted
Key-sharing problem? Yes — the secret key must somehow be shared safely first (in person, by post, or via an algorithm) No — the public key can be shared openly since it can't decrypt anything on its own

What to Memorise

Encryption Scrambling data before transmission so it's meaningless without the correct key.
Plaintext Data before encryption — the readable original.
Ciphertext Data after encryption — the scrambled version that gets transmitted.
Master key Generated from SSID + password on wireless networks; identical on both router and device; never transmitted.
SSID Service Set Identifier — the name of a wireless network.
WPA2 A dedicated security protocol designed specifically for Wi-Fi encryption.
HTTPS Example of application-level encryption used on wired (and wireless) connections to secure web traffic.
Symmetric encryption One identical secret key shared by sender and receiver, used for both encrypting and decrypting.
Asymmetric encryption A public key (known to all, used to encrypt) paired with a private key (known only to the receiver, used to decrypt).
Key A binary string used with an encryption algorithm to encrypt/decrypt data — the longer the key, the harder to guess.

Concepts Checklist

Exam Tips

Don't Just Say "It Keeps Data Safe"
Examiners want precision. Never write a vague answer like "encryption keeps data safe." Always mention: plaintext becomes ciphertext, and only authorised users with the correct key can decrypt it. That specific wording is where the marks actually come from.
Common Mistake
Students often incorrectly describe asymmetric encryption as using "a private key and a password." The public key (used to encrypt) is not the same thing as a generic password — don't confuse the two. There is no password involved in the asymmetric process itself; it's public key vs private key.
Fill-in-the-Blank Style Questions
This topic is often tested with terminology gap-fills (as in the worked example): before encryption → plain text; the tool used to scramble it → key/algorithm; after encryption → cipher text; what encryption prevents → data being understood by a hacker. Learn these exact terms — near-synonyms won't always get the mark.
Comparison Questions
If asked to compare symmetric and asymmetric encryption, always anchor your answer on the number of keys and whether the key travels over the network — those two differences are the ones examiners are most often testing.
🔓 Read the full Encryption note — free You're seeing the preview · free account, no card needed
Also in the full note
  • 4. Keys, Plaintext & Ciphertext
What's inside
📖 Revision notes 🎯 Learn mode ✦ AI flashcards ✓ Instant AI marking 🧊 3D explorers 🧪 Experiments & simulations 📈 Progress tracking
📄 Practise Encryption with Computer Science 0478 past papers Every paper with its mark scheme — answer online, marked instantly. Open →

Read the full Encryption notes free

That's the preview — create a free account to read the rest, plus flashcards and practice questions with instant AI marking. No credit card.

Unlock the full notes free →

More Computer Science topics