# Encryption

> CIE A-Level Computer Science · 9618
> Source: https://www.owlsprep.com/study/cie-9618-u6-encryption/

This module covers core encryption concepts for CIE A-Level 9618, including simple ciphers, symmetric and asymmetric systems, their applications, and key examinable comparisons and calculations.

**Prerequisites:** [Basic understanding of prime numbers and modular arithmetic](https://www.owlsprep.com/study/cie-9618-u1-data-representation/)

## Learning objectives

- Distinguish between symmetric and asymmetric encryption systems
- Explain encryption applications for data in transit and at rest
- Complete simple encryption calculations for Caesar and RSA ciphers
- Evaluate tradeoffs between different encryption methods for exam questions

## Core Concepts and Simple Ciphers

**Encryption** — The process of transforming readable plaintext into unreadable ciphertext to prevent unauthorized access. Decryption reverses this process using a secret key.

*Example:* Encrypting customer payment data before storing it in a company database

Simple substitution ciphers are commonly used in CIE exam questions to test basic encryption principles. The most frequent example is the Caesar cipher.

**Caesar Cipher** — A substitution cipher where each plaintext letter is shifted $k$ positions along the alphabet. Decryption requires shifting back by the same $k$.

*Notation:* Shift = $k$

**Worked example:** Encrypt the plaintext *CODE* using a Caesar cipher with shift $k=3$, where $A=0, B=1, ... Z=25$.

1. Convert each plaintext letter to its numerical value:
2. $$C = 2, O = 14, D = 3, E = 4$$
3. Add the shift value to each number, mod 26:
4. $$2+3=5, 14+3=17, 3+3=6, 4+3=7$$
5. Convert the new values back to letters:
6. $$5=F, 17=R, 6=G, 7=H$$
7. Final ciphertext is **FRGH**

> **Exam tip:** Always check if the question defines A as 0 or 1, this changes the final ciphertext output.

## Symmetric Encryption

**Symmetric Encryption** — An encryption system where the same secret key is used for both encryption and decryption. The key must only be shared between authorized parties.

Common examinable symmetric algorithms are AES (Advanced Encryption Standard), DES, and 3DES. Symmetric encryption is very fast, making it ideal for encrypting large volumes of data.

> **info**
>
> The main limitation of symmetric encryption is secure key distribution: if the key is intercepted during sharing, any third party can decrypt all messages.

**Worked example:** Alice and Bob want to communicate using AES-256 symmetric encryption over an unsecured public channel. Why is this not secure?

1. Any key sent over an unsecured public channel can be intercepted by an attacker
2. If the attacker gains the secret key, they can decrypt all subsequent encrypted messages between Alice and Bob
3. No pre-existing shared secret exists to encrypt the key itself during exchange, so there is no way to secure it

## Asymmetric Encryption

**Asymmetric Encryption** — An encryption system that uses a pair of mathematically linked keys: a public key (shared openly) and a private key (kept secret by the owner).

- Data encrypted with a user's public key can only be decrypted with their matching private key
- Data signed with a user's private key can be verified by anyone with their public key (used for digital signatures)

The most common examinable asymmetric algorithm is RSA, which relies on properties of prime numbers. Below is a worked simple RSA example for exam practice:

**Worked example:** Given RSA $n = 55 = 5 \times 11$, public exponent $e = 7$, encrypt plaintext $M = 12$.

1. RSA encryption formula is:
2. $$C = M^e \mod n$$
3. Substitute values:
4. $$C = 12^7 \mod 55$$
5. Break down the exponent to simplify calculation: $12^7 = 12^4 \times 12^2 \times 12^1$
6. $$12^2 = 144 \equiv 144 - 2(55) = 34 \mod 55$$
7. $$12^4 = (12^2)^2 = 34^2 = 1156 \equiv 1156 - 21(55) = 1 \mod 55$$
8. Multiply and take mod 55:
9. $$C = 1 \times 34 \times 12 = 408 \equiv 408 - 7(55) = 23 \mod 55$$
10. Final ciphertext $C = 23$

**Comparing methods**

CIE frequently asks to compare symmetric and asymmetric encryption, key properties are below:

- **Symmetric Encryption** — Same key for encrypt/decrypt, key must be kept secret
  - Pros: Very fast, suitable for large datasets; Small key size for equivalent security
  - Cons: Secure key distribution requires pre-shared secret; Poor support for digital signatures

- **Asymmetric Encryption** — Separate public and private keys, public key can be shared openly
  - Pros: Secure key exchange over public channels; Native support for digital signatures
  - Cons: Slow, computationally intensive; Unsuitable for large volumes of data

> **Exam tip:** Break RSA exponents into powers of two to avoid calculating huge numbers, this saves time and reduces calculation errors.

## Applications of Encryption

Encryption is used to secure two main states of data:

- **Data at rest**: Encrypting stored data such as full hard drives, password databases, and customer payment information
- **Data in transit**: Encrypting data sent over public networks, for example HTTPS web traffic, email, and VPN connections
- **Digital signatures**: Verifying the authenticity of software updates, legal documents, and websites by signing a hash of the content with the sender's private key

**Check your understanding**

Test your understanding

1. Which type of encryption is used to encrypt bulk data transferred over HTTPS?

   - Symmetric encryption
   - Asymmetric encryption
   - RSA encryption
   - No encryption

   *Answer:* Symmetric encryption

   *Why:* Correct! HTTPS uses asymmetric encryption to exchange a symmetric session key, then uses the faster symmetric encryption for all bulk data transfer.

## Common pitfalls

- **Wrong:** Confusing encryption with hashing
  - Why it fails: Examiners frequently test this distinction, mixing the two loses easy marks
  - Correct: Remember: Encryption = reversible confidentiality, Hashing = one-way integrity checking
- **Wrong:** Claiming asymmetric encryption is always better than symmetric
  - Why it fails: Asymmetric is much slower, so it is not used for large data
  - Correct: State that the two methods are used together: asymmetric for key exchange, symmetric for bulk data
- **Wrong:** Mixing up which key encrypts/decrypts in asymmetric encryption
  - Why it fails: Common confusion about public/private key roles
  - Correct: To send a message to someone: encrypt with their public key, only their private key can decrypt it
- **Wrong:** Calculating full large exponents for RSA questions
  - Why it fails: This leads to arithmetic errors and wastes valuable exam time
  - Correct: Break the exponent into powers of two, take mod $n$ at each step to keep numbers small
- **Wrong:** Claiming asymmetric encryption uses one shared key
  - Why it fails: Mixes up symmetric and asymmetric core properties, a common exam trap
  - Correct: Remember: symmetric = 1 shared key, asymmetric = 2 keys per user (public + private)

## Cheatsheet

| Property | Symmetric Encryption | Asymmetric Encryption |
| --- | --- | --- |
| Number of keys | 1 shared secret key | 2 keys per user: public + private |
| Key distribution | Requires secure pre-shared channel | Public key can be shared openly |
| Speed | Very fast, low computation | Slow, high computation |
| Best for | Bulk data, data at rest | Key exchange, digital signatures |

## What's next

Encryption is a foundational concept for all security topics in CIE 9618 Paper 2, and it is regularly combined with other security concepts in extended response questions. Understanding the tradeoffs between symmetric and asymmetric encryption is critical for answering questions about HTTPS, digital certificates, and secure network communication. Encryption is often paired with hashing for data integrity, and forms the basis of all modern secure systems. Next, you can explore related security topics to build your full understanding of the unit.

- [Access Control](https://www.owlsprep.com/study/cie-9618-u6-access-control/)
- [Data integrity](https://www.owlsprep.com/study/cie-9618-u6-data-integrity/)
- [Privacy issues](https://www.owlsprep.com/study/cie-9618-u6-privacy-issues/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/cie-9618-u6-encryption/
