📄 Paper 2 · 4.5 Data Representation
4.5.6d Encryption
AQA 7517 · A-Level Computer Science · ~14 min read

What is Encryption?

Encryption transforms plaintext (readable data) into ciphertext (unreadable scrambled data) using an algorithm and a key. Only someone with the correct key can decrypt it back to plaintext. Encryption protects data from unauthorised access during storage or transmission.

Key Terminology

TermDefinition
PlaintextThe original, readable message/data
CiphertextThe encrypted, unreadable output
EncryptionConverting plaintext → ciphertext using a key
DecryptionConverting ciphertext → plaintext using a key
KeyA value (bit string) used by the algorithm to encrypt/decrypt
CipherThe algorithm used to encrypt/decrypt

Symmetric Encryption (Private Key)

Both sender and receiver use the same key to encrypt and decrypt. Also called private key or secret key cryptography.

Advantages

  • Fast — computationally efficient, suitable for large amounts of data
  • Simple concept — one key, one algorithm

Disadvantages

  • Key distribution problem — how do you securely share the key with the recipient in the first place? If intercepted, the encryption is broken
  • Does not scale well — need a different key for every pair of communicating parties

Examples

AES (Advanced Encryption Standard), DES (older), 3DES

Asymmetric Encryption (Public Key)

Uses a mathematically linked key pair: a public key (shared openly) and a private key (kept secret by the owner). Data encrypted with the public key can only be decrypted with the private key.

How it works for confidential messaging

  • Alice publishes her public key to everyone
  • Bob wants to send Alice a secret message — encrypts it with Alice's public key
  • Only Alice's private key can decrypt it — even Bob cannot read it after encrypting

Advantages

  • No key distribution problem — public key can be shared openly with no risk
  • Enables digital signatures — sender encrypts a hash with their private key; anyone can verify it with the public key
  • Scales: one key pair per person, not one per pair of communicators

Disadvantages

  • Much slower than symmetric encryption — computationally intensive
  • Key pairs are much larger (typically 2048+ bits vs 256 bits for symmetric)

Examples

RSA, ECC (Elliptic Curve Cryptography)

Hybrid Encryption (Real-World Use)

HTTPS uses both: asymmetric encryption to securely exchange a symmetric session key, then the fast symmetric key for the actual data transfer. This solves the key distribution problem while maintaining speed.

Caesar Cipher (Historical Example)

A simple substitution cipher — each letter is shifted by a fixed number. E.g. shift 3: A→D, B→E. Plaintext: HELLO → Ciphertext: KHOOR. Easily broken by frequency analysis — not used today.

Digital Signatures & Hashing

A hash function converts data to a fixed-length digest. Even a tiny change produces a completely different hash. Used for integrity — verifying data hasn't been tampered with. Digital signatures combine asymmetric encryption with hashing to prove authenticity and integrity.

Exam tip: Know the distinction between symmetric (same key, fast, key distribution problem) and asymmetric (key pair, slow, solves distribution). Know the terms plaintext, ciphertext, key, encryption, decryption. Be able to describe how asymmetric encryption works — the public key encrypts, only the private key decrypts. AQA may ask you to evaluate which method is appropriate in context or to describe how HTTPS uses hybrid encryption.
Click through the slides at your own pace. Use arrow keys or click to advance.
Click slide or press arrow keys to navigate

Worksheet — 4.5.6d Encryption

8 questions · instantly marked · AQA 7517 standard

Q1Explain the difference between symmetric and asymmetric encryption.[4]
✅ Mark scheme
Mark scheme
Symmetric: same key used to encrypt and decrypt [1]; fast but has a key distribution problem — key must be securely shared [1]. Asymmetric: uses a key pair — public key (shared openly) for encryption and private key (kept secret) for decryption [1]; slower but no key distribution problem [1].
Q2Describe how Alice would use asymmetric encryption to receive a confidential message from Bob.[4]
✅ Mark scheme
Mark scheme
Alice generates a key pair and shares her public key openly [1]; Bob obtains Alice's public key and uses it to encrypt the message [1]; the encrypted message (ciphertext) is sent to Alice [1]; Alice decrypts it using her private key — only Alice's private key can decrypt data encrypted with her public key [1].
Q3State two advantages and one disadvantage of symmetric encryption.[3]
✅ Mark scheme
Mark scheme
Advantages (any two): computationally fast / efficient for large data [1]; simple — single key for both operations [1]. Disadvantage: key distribution problem — the shared key must be transmitted securely, and if intercepted the encryption is broken [1].
Q4Explain what the 'key distribution problem' is in symmetric encryption and how asymmetric encryption solves it.[3]
✅ Mark scheme
Mark scheme
Key distribution problem: the secret key must be shared between communicating parties, but transmitting the key creates a risk of interception — if the key is captured, all encrypted messages are compromised [1]. Asymmetric encryption solves this: the public key is shared openly — knowing it does not allow decryption [1]; the private key never needs to be transmitted, so there is nothing to intercept [1].
Q5Describe how HTTPS uses hybrid encryption. Why is this approach better than using asymmetric encryption alone?[4]
✅ Mark scheme
Mark scheme
HTTPS uses asymmetric encryption to securely exchange a symmetric session key [1]; the actual web traffic is then encrypted using the symmetric session key [1]. Better than asymmetric alone because: asymmetric encryption is much slower [1]; symmetric encryption is efficient for encrypting large amounts of data — so hybrid combines security of asymmetric key exchange with speed of symmetric data encryption [1].
Q6A Caesar cipher shifts each letter by 3. Encrypt the message: COMPUTING[2]
✅ Mark scheme
Mark scheme
C→F, O→R, M→P, P→S, U→X, T→W, I→L, N→Q, G→J = FRPSXWLQJ [1]; correctly applying +3 shift to each letter with wrap-around at Z [1].
Q7Explain the role of a hash function in ensuring data integrity.[3]
✅ Mark scheme
Mark scheme
A hash function converts data to a fixed-length digest/hash value [1]; any change to the original data produces a completely different hash [1]; by comparing the hash of received data with the expected hash, any tampering can be detected [1].
Q8A company stores user passwords as hashes rather than plaintext. Explain why this approach is more secure.[3]
✅ Mark scheme
Mark scheme
If the database is breached, attackers only obtain hashes, not plaintext passwords [1]; hash functions are one-way — it is computationally infeasible to reverse a hash back to the original password [1]; even the company cannot read users' plaintext passwords, reducing insider threat risk [1].
Topic Quiz
Question 1 of 15
You scored
out of 15
Card 1 of 10
Click to reveal definition
🎉
All cards reviewed!
TermDefinition
🎯

Mini Test — Encryption

10 questions · 10 minutes

← 4.5.6c Data Compression
44 of 70 · AQA 7517
4.6.1 Hardware & Software →