Revision Notes
OxfordAQA A-Level Computer Science (9645): Basic encryption methods – Revision Notes
Recall notes for OxfordAQA 9645 sub-topic 3.5.7: Caesar and Vernam ciphers, perfect and computational security, key exchange and a self-test.
- Subject
- Computer Science
- Level
- AS LEVEL
- Topic
- Topic 5 – Representing data
- Author
- Marlbridge Academic Team
- Updated
- Reviewed by
- Harris Khan (what this means)
Aligned to OxfordAQA A Level Computer Science (9645), 2024-onwards. Official specification .
Syllabus page (what it covers and how it is assessed): OxfordAQA A Level Computer Science.
Syllabus points this page covers
9645 (AS Level)
- 3.5.7 Basic encryption methods
This page covers 1 of the 8 subtopics in topic 5, Representing data.
Found an error? Report a correction.
Need help with this topic? Request a free trial class for A Level Computer Science (9645).
These notes condense sub-topic 3.5.7 Basic encryption methods of OxfordAQA International AS and A-level Computer Science (9645), Version 1.1 (AS content in topic 3.5 Representing data). For worked examples, see the basic encryption methods study guide; then practise with the basic encryption methods practice questions.
What the specification requires
- Define encryption: the use of an algorithm to convert plaintext into ciphertext so it cannot easily be understood by a third party who does not know both the method and the key.
- Know cipher, plaintext, ciphertext and key.
- Apply the Caesar cipher (encrypt and decrypt) and explain why it is easily cracked.
- Apply the Vernam cipher (one-time pad) to encrypt and decrypt.
- Know what perfect security is, that the Vernam cipher can achieve it, and the conditions needed.
- Compare the Caesar and Vernam ciphers.
- Know that most computer ciphers rely on computational security; compare with the Vernam cipher.
- Understand the key exchange problem; know symmetric and asymmetric ciphers.
Key terms
| Term | Meaning |
|---|---|
| Plaintext | The original message |
| Ciphertext | The encrypted message |
| Cipher | The algorithm that encrypts and decrypts |
| Key | A value (letters or bits) used by the cipher |
| Perfect security | Nothing can be learned about the plaintext from the ciphertext |
| Computational security | Information could be learned, but cracking takes an unfeasible time or has very low chance of success |
| Key exchange problem | Sharing the key without it being intercepted |
| Symmetric | The same key encrypts and decrypts |
| Asymmetric | Different, mathematically related keys encrypt and decrypt |
Caesar cipher
Shift each letter along the alphabet by the key; wrap from Z to A. Decrypt by shifting back.
Recomputed:
| Plaintext | Key | Ciphertext |
|---|---|---|
| COMPUTER SCIENCE | 9 | LXVYDCNA BLRNWLN |
| GOOD MORNING | 11 | RZZO XZCYTYR |
| LOCK THE DOOR | 6 | RUIQ ZNK JUUX |
| ZEBRA | 5 | EJGWF |
| YZ | 3 | BC |
Decrypting EJGWF with key 5 gives ZEBRA, because the shift is reversed (E back 5 is Z).
Why it is easily cracked
- Only 25 possible keys.
- Letter frequencies in the ciphertext match those of the plaintext (frequency analysis).
- Once the shift of one letter is found, it is known for all letters.
Vernam cipher
Bitwise form: ciphertext = plaintext XOR key. Decrypt with the same operation.
XOR: 0 and 0 gives 0; 0 and 1 gives 1; 1 and 0 gives 1; 1 and 1 gives 0.
| Letter | Plain bits | Key bits | Cipher bits |
|---|---|---|---|
| H | 01001000 | 01101011 | 00100011 |
| i | 01101001 | 10010110 | 11111111 |
Check: 00100011 XOR 01101011 gives back 01001000.
Finding a key. Plaintext XOR ciphertext gives the key. 01001111 XOR 11000110 = 10001001.
Letter form: add the key letter’s value (A = 0 to Z = 25) modulo 26. Recomputed: SEND with key QVRJ gives IZEM; BOX with key MAD gives NOA.
Conditions for perfect security
- The key is completely random.
- The key is at least as long as the plaintext.
- The key is used only once.
- The key is known only to the sender and receiver.
Why it works: with a random key as long as the message, any plaintext of that length could have produced a given ciphertext. The same ciphertext IFR is made from YES with key KBZ, so the ciphertext alone tells you nothing.
Computational security
- Information about the plaintext can be found, but cracking takes unfeasible time or has a very low probability of success.
- Uses short, reusable keys, so it is practical.
- Most ciphers used by computers are of this kind.
Comparisons
| Caesar | Vernam | Computationally secure | |
|---|---|---|---|
| Security | Almost none | Perfect, if conditions met | High in practice |
| Key | One shift (25 choices) | Long, random, used once | Short, reusable |
| Practical use | Teaching | Rare because of key length and sharing | Widespread |
Key exchange and key types
| Symmetric | Asymmetric | |
|---|---|---|
| Keys | One key for both | Two related keys |
| Key exchange problem | Yes | No (the encryption key can be public) |
| Examples in the specification | Caesar, Vernam | (type, no named cipher needed) |
Exam traps
- Direction. Add to encrypt and subtract to decrypt in the Caesar cipher.
- Wrap-around. After Z comes A.
- Four conditions. Vernam is perfectly secure only when all four hold.
- Reusing a key breaks the one-time property.
- Computational is not perfect. Information can be learned in principle.
- Both Caesar and Vernam are symmetric.
- XOR check. Ciphertext XOR key must return the plaintext.
Quick self-test
- Define encryption.
- Encrypt ZEBRA with a Caesar key of 5.
- Decrypt RUIQ ZNK JUUX with key 6.
- State three reasons the Caesar cipher is easily cracked.
- What does XOR give for 1 and 1?
- Encrypt the bits 10110110 with the key 01101101.
- What is perfect security?
- List the four conditions for the Vernam cipher to be perfectly secure.
- What is a computationally secure cipher?
- What is the key exchange problem?
- Is the Vernam cipher symmetric or asymmetric?
- Why does an asymmetric cipher avoid the key exchange problem?
Answers
- Using an algorithm to convert plaintext into ciphertext so it cannot easily be understood by someone who does not know both the method and the key.
- EJGWF.
- LOCK THE DOOR.
- Only 25 keys; letter frequencies are preserved; one found shift reveals all.
-
-
- Nothing can be learned about the plaintext from the ciphertext.
- Random key; at least as long as the plaintext; used once only; known only to sender and receiver.
- One where information could be learned but cracking takes an unfeasible time or has a very low chance of success.
- Sharing the key between sender and receiver without it being intercepted.
- Symmetric.
- The encryption and decryption keys are different, so the encryption key need not be kept secret.
- Basic encryption methods study guide
- Basic encryption methods practice questions
- Representing sound revision notes
Official syllabus
OxfordAQA International AS and A-level Computer Science (9645) specification, Version 1.1, for International AS exams May/June 2025 onwards and International A-level exams May/June 2026 onwards: sub-topic 3.5.7 Basic encryption methods.
Related resources
-
Study guides
OxfordAQA A-Level Computer Science (9645): The binary number system
OxfordAQA 9645 sub-topic 3.5.3 in depth: unsigned and two's complement binary, fixed and floating point, errors, overflow and normalisation.
Computer Science · OxfordAQA · AS Level
Read guide -
Practice questions
OxfordAQA A-Level Computer Science (9645): The binary number system – Practice Questions
Twelve original OxfordAQA 9645 questions on sub-topic 3.5.3: unsigned and two's complement arithmetic, fixed and floating point, errors and normalisation.
Computer Science · OxfordAQA · AS Level
Try questions -
Revision notes
OxfordAQA A-Level Computer Science (9645): The binary number system – Revision Notes
Recall notes for OxfordAQA 9645 sub-topic 3.5.3: unsigned and two's complement, fixed and floating point, errors, overflow, normalisation and a self-test.
Computer Science · OxfordAQA · AS Level
Revise topic
Get free revision emails (optional)
Occasional emails with practice questions, worked explanations and links to free resources for the qualification and subjects you choose. No spam, and you can unsubscribe from any email. The free tools on this site never need an email.