Year 12

AQA A level Computer Science [P1] Security Notes

Security & Data Integrity

— Computer Science · AS Level (9618) · Paper 1 —
★ Exam Tip: Small chapter but LOTS to memorise — write every answer out again and again (sir wrote the same answer 15–20 times!) and revise 15 min every day. Learn all points even if the question is only 2 marks — in the exam a different point "clicks". Do topical past papers, and the Paper 3 malware questions too (malware moved from Paper 3 → Paper 1). Understand it = memorisation, not rattā.

1. Data Integrity vs Data Privacy vs Security

Most students think these are the same thing — they are NOT. Past papers ask 1–2 mark "what is meant by…" questions, so know the difference.

① Data Integrity ② Data Privacy ③ Security
Meaning Is making sure that data is correct / valid. Ensures data received is same as the data sent Keeps data confidential. Only seen by authorized personnel Is to keep data safe. Prevention of data loss
Keyword VALID / same as sent AUTHORIZED only data LOSS
e.g. parity check stop 3rd person reading it (encryption, passwords) data backup
SenderReceiver 10111111 got 10110111 ✗ 1 bit CHANGED Integrity issue
data changes in transit
SenderReceiver 3rd personreads it! Privacy issue
unauthorized person sees data
USB lost / virus / deleted = DATA LOSS Security issue
data is lost
Sir's examples:
Integrity: I send the name "Taha" → passed person to person → 4th person receives "Talha" ⇒ data no longer valid/same. Fix: resend the data.
Privacy: I send my city (hidden as ‑ ‑ ‑ ‑) to a trusted person but someone else reads it via hacking/virus ⇒ privacy issue.
Security: student records in an Excel file get deleted / virus / USB lost or thrown away ⇒ data loss ⇒ security issue.
Trick: data changes → INTEGRITY · 3rd person sees → PRIVACY · data lost → SECURITY.

2. Security Measures to Protect Computer

Covers stand-alone computers, computers on a LAN and networks / internet. Learn all 8 measures + the other ways to protect data online.

① Encryption

PAPERSDOCK APPREDSCKO plain textscrambled (cipher) text ALGORITHM + encryption key = ENCRYPTION DECRYPTION (decryption key)
encryption scrambles; the decryption key unscrambles it back
  • Encryption scrambles the source code
  • Using an encryption key
  • If the file is accessed without authorization it will be meaningless
  • It requires a decryption key to unscramble the algorithm
Sir's memory trick: keep 4 keywords → SCRAMBLE – ENCRYPTION key – MEANINGLESS – DECRYPTION key. From these 4 words you can rebuild the whole answer. If the question is about text, write "encryption scrambles the text" instead of "source code". (Public / private keys, asymmetric encryption = A2.)

② Data Backup

  • A copy of data will have been made and stored elsewhere
  • If the original data is lost, the backup can be used to restore the data
Keyword: "stored ELSEWHERE". You pick a fixed time and copy the data to another place.

③ Disk Mirroring

Data X Y ZX Y Z Disk 1Disk 2 same time
written to both disks simultaneously
  • The data is stored on two disks simultaneously
  • If the first data disk drive fails, the data is accessed from the second disk
Keyword: SIMULTANEOUSLY. Mirroring is basically a backup, but done on a disk at the same time.
Analogy: bank deposit slip with a blue & green page — what you write on green is copied on blue at that moment = mirroring. Scan the slip and keep it on your phone later = backup.
Data backup Disk mirroring
When copied at a fixed time later same moment, simultaneously
Where stored elsewhere (another medium/place) 2nd disk running alongside

④ Firewall

Internet allowed ✓ (on allow list) unauthorized IP / site / no SSL ✗ BLOCKED FIREWALL PCs onyour network
like a fire-wall in a building — fire can't spread to the next room; unwanted traffic can't pass
  • Prevents unauthorized access to the data
  • Monitors incoming and outgoing traffic
  • Blocks transmission from unauthorized sources / websites
  • Maintains an allow list
  • Can be software or hardware both
  • Can help to prevent hacking
Sir's extra detail: traffic is filtered by rules — e.g. never accept files from IP 192.168.0.0. The allow list is a table of what to allow/deny (IP addresses, ports, websites). Sites with an SSL certificate (https, padlock 🔒) are allowed; sites without get blocked/warned.
Hardware firewall (e.g. WatchGuard Firebox box, built into routers) = big organisations, more stable & secure. Software firewall (e.g. Windows Defender Firewall — pre-installed or 3rd-party) = more flexible, easy to change. Hacking is never impossible, just harder.

⑤ User Account

  • User has an username and password
  • Access to resources can be limited to specific accounts
  • A person cannot access the system without a valid username and password
Keywords: username · password · resources. e.g. a course where each student gets their own login. (User account ≠ access rights — see ⑦.)

⑥ Anti-Malware

  • Scans for malicious code (= harmful code)
  • Quarantines or deletes any malicious software found
  • Scans can be scheduled at regular intervals
Quarantine = isolate it so it can't spread. Used when the malware can't be deleted yet — then restore the data from a backup.

⑦ Access Rights

  • Different access rights for individual / group
  • To stop users from editing the program
Examples: you decide who can open/download a drive file, or use the mic. You can't change MS Word's functionality because you were never given rights to its source code.

⑧ Physical Measures

  • Locked doors / keyboards
  • Secure method of access
Sir: keep the hard drive in a highly secured room; hide / protect the keyboard so nobody plants spyware or swaps it (keylogger). If confused, just write "lock doors".
Q: What are the other methods to protect data online?
  • Running up-to-date anti-virus (viruses keep updating, so the anti-virus must too)
  • Use of a proxy server
  • Strong biometrics / password

Proxy Server

PClaptopphone 192.168.1.0(your private IP) 22.11.2.1(proxy's own IP) Proxy ServerInternetYou
acts as the middle man and hides the public IP address of the user

A proxy server is a physical device (a server) that works like an agent / middle man (think buyer → agent → seller).

  • Without a proxy: you access the internet with your own public IP ⇒ your location can easily be found.
  • With a proxy: the proxy keeps your IP and talks to the internet with its own IP; replies come back to the proxy, which forwards them to you ⇒ more privacy.
  • Extra (not syllabus): proxy has a cache (temporary memory) — a site you opened once is stored, so asking again saves bandwidth. Offices also use it to monitor which sites each user visited and for how long (so be careful at home!).
  • VPN also changes your IP (useful if YouTube is banned).
Q: What are the factors to consider when planning a data backup? (1 mark explanation + 1 mark example — examples matter)
Factor Question to ask e.g. (write this!)
① How often How often should the data be backed up? at the end of each day, as students' progress may be edited each day
② Medium What medium should the data be backed up to? external hard disk, as it has larger capacity (also USB, CD…)
③ Where stored Where should the backup be stored? (not the device — where the device is kept) off site — if the building is damaged only the original data are lost
④ What What is backed up? only the updated file(s)
⑤ When When should the backup take place? (time of day) over night (e.g. WhatsApp backs up at 2 a.m.)
Learn in your own language: how often · which medium · where stored · what · when. Even for a 2-mark question learn all five.

3. Malware

Definition: Malware is software that is intentionally designed to cause damage to a computer or server.

Keyword: INTENTIONALLY. Accidental damage is a different scenario — not malware.

Types of malware: viruses, worms, logic bombs, trojan horses, spyware

Note: The 9618 syllabus only names viruses and spyware (worms appeared in A2), but learn logic bombs & trojans too — no harm. Old Paper-3 style questions give a description → you name the malware, or ask for its problem / solution. So know each one individually.
Q: Explain the term virus? (2–4 marks)
  • Malicious code (= harmful code)
  • that replicates / copies itself
  • can cause loss of data
  • can cause computer to crash
  • can fill up the hard disk with data (copies take space)
Q: What are the ways to protect from a virus?
  • Use anti-virus · update anti-virus on regular basis
  • Avoid downloads from unknown sources · avoid suspicious websites
  • Use a firewall (stops viruses coming in through the network)
Prevention beats cure: like fire — preventing a fire is better than fire-fighting. Don't go where a virus can come from. (Virus example: a "friend" emails you a file with a virus → your whole PC gone.)

(1) Virus

Definition: Programs or program code that can replicate itself by inserting itself into another piece of software with the intention of deleting or corrupting files.

Problem: computer may stop working or files may get lost. Solution: run anti-virus software.

Identify it: "inserting into another piece of software" = needs a HOST ⇒ VIRUS.

(2) Worms

Definition: A standalone piece of software which can reproduce itself automatically, does not require a host.

Problem: could corrupt user's computer ‖ delete data ‖ consume bandwidth (it keeps reproducing).

Solution: run anti-virus in the background ‖ keep OS up to date ‖ not connected to the internet.

Virus vs Worm: ask "does it need a host?" — yes → virus, no (standalone) → worm. Keywords for worms: standalone + does not require a host. (All malware must be opened/run for the code to start executing.)

(3) Logic Bombs

Code embedded in a program on a computer. When certain conditions are met (such as a specific date) they are activated to carry out tasks such as deleting files or sending data to a hacker.

Think: it just waits for a criterion (e.g. 12 o'clock, a set date) → the moment it is met, it executes.

(4) Trojan Horses

freegame.exe maliciouscode!
looks like a gift, harmful inside

Same as that Greek horse story — soldiers hid inside a wooden horse (sent as a "gift"); when it entered the city, they came out at night and attacked.

Definition: Malicious program often disguised as legitimate software with the intent of harming the computer.

(5) Spyware

Definition: Software that gathers information by monitoring, for example key presses on user's keyboard. The information is then sent back to the person who sent the software.

keyboard A H T A H A 1 47 6 5 …(user + pass) spyware sends keys hacker
keys typed (username + password) are recorded and sent to the hacker ⇒ e.g. online-banking details stolen

Solution: Anti-spyware software. Also: avoid the physical keyboard — use an on-screen keyboard / touch screen, since a keylogger only records real key presses.

Keylogger vs spyware: same idea, but a keylogger is only about keys; spyware is wider (e.g. reading someone's saved notes/passwords). A malware can even be a trojan + spyware combined.

Phishing and Pharming

Two ways malware / fraud reaches you (O-level concept — revise!).

email click FAKEwebsite steals confidentialdata / installs malware
PHISHING = email → fake site
user's PC / web server code FAKEwebsite code redirects user,even if real URL typed
PHARMING = installed code → fake site

Phishing: Someone sends email to users; when clicked it takes the user to a fake website so they could obtain somebody's confidential data or to install malware.

Problem: identity fraud ‖ misuse of financial data (card number, bank info, OTP). Solution: ignore suspicious email and undergo frequent security awareness training.

Training idea: companies/universities make staff identify tempting emails ("you won a prize/car!") — like WhatsApp "you won a car, send balance" scams: once you've seen them often, you spot them. Past-paper question!

Pharming: Malicious code installed on user's computer or web server. The code redirects the user to a fake website.

Difference: phishing uses emails; pharming uses code already installed on the computer/server to redirect you.

4. Data Integrity — Validation & Verification

Malware finished data security. Now data integrity = data is correct/valid and received same as sent. It has two parts:

Validation Verification
Checks that the data entered is reasonable (meets a criterion) Checks that the data entered is same as the original
e.g. age = −40 can't be accepted e.g. typed 50 but receiver gets 51 ✗
Past-paper Q: "Describe the difference between validation and verification" — write the two lines above.

Validation checks (exam gives a scenario → you pick the check)

Check What it checks e.g.
Range check data is between a lower and upper limit 13 as month, −120 as age ✗ (months 1–12)
Format check data entered in the agreed format date is dd/mm/yyyy — 12-01-2006 ✗ , 12/01/2003 ✓
Length check data has the required number of characters phone number should contain 7 numbers; password of 7 chars
Presence check a field is not left empty when it should contain data verification code present; compulsory * fields (middle name optional)
Existence check data in a file / a file name actually exists registered name is found (student registered?)
Limit check checks only one of the limits (upper or lower) 1.5 litre only (bottle)
Check digit an additional digit added to a number see next page
11213 ✗ lower AND upper limit RANGE check
both ends fixed (months 1–12)
1.5 Lmore ✗ only ONE limit (upper) LIMIT check
only one boundary matters
Range vs Limit: range = lower + upper limit (1 to 12); limit check = a single limit (up to 1.5 L). Presence = is it filled in? Existence = does it exist in the file?

Check Digit — Calculating It

Careful: the syllabus lists check digit under validation, but sir says it is really part of VERIFICATION — you never "validate" with a check digit, you verify the data arrived/was typed correctly. Don't get confused!
Method for calculating a check digit ① Give each digit a weighting, e.g. 7, 6, 5, 4, 3, 2, 1 — starting from the left (never random; 7-digit number → 7…1)
② Multiply each digit by its weighting, then add all values to make a total
③ Divide the total by 11 and subtract the remainder from 11 → that is the check digit
Example: number 4 1 5 6 7 1 0
digit 4 1 5 6 7 1 0
weight 7 6 5 4 3 2 1
digit × weight 28 6 25 24 21 2 0
28 + 6 + 25 + 24 + 21 + 2 + 0 total = 106 106 ÷ 11 = 9 remainder … (11 × 9 = 99) 106 − 99 = 7 ⇒ remainder = 7 11 − 7 = 4 ← check digit no calculator in the exam — add by long working / mental maths. Number becomes 41567104.

5. Verification

Definition: a way of preventing errors when data is entered manually using a keyboard or when data is transferred from one computer to another. Two situations, studied separately:

Verification during data entry

  • Double entry: data is entered twice, using two different people, and then compared. (must be another person — not you typing twice!)
  • Visual check: entered data is compared with the original document (e.g. re-read the typed passport number against the real passport, letter by letter).
  • Check digit (3rd method, sir) — extra digit calculated & attached; see above.

Verification during data transfer

Three methods: ① Check sum   ② Parity check   ③ Automatic Repeat Request (ARQ) — O-level topics, but revise.

① Checksum

  • Bytes sent as a block
  • Bytes are added up before transmission
  • Result of the addition is sent with the data block
  • The same calculation is carried out at the receiver's end
  • The two values are compared
Mark scheme = these 5 points. Don't write "1's complement" in the exam — that's the real-life version shown below. A block = group of bits; how many blocks & bits per block is decided in advance and varies.
block 1 01011011block 2 10001110 ADD= 11101001 apply 1'scomplement CHECKSUM00010110 SENDER sent together as 3 blocks (data + checksum block): 010110111000111000010110 RECEIVER addsALL 3 blocks 11111111ALL 1's ✓ any 0 in the answer ⇒ error in transfer ⇒ data must be resent
receiver can't tell which block is data / checksum, so it just adds all of them
Sender 0 1 0 1 1 0 1 1 + 1 0 0 0 1 1 1 0 carries: 1 1 1 1 (1+1 = 0 carry 1) sum = 1 1 1 0 1 0 0 1 1's complement ⇒ 0 0 0 1 0 1 1 0 = checksum (invert every bit)
Receiver 0 1 0 1 1 0 1 1 + 1 0 0 0 1 1 1 0 + 0 0 0 1 0 1 1 0 = 1 1 1 1 1 1 1 1 all 1's ⇒ correct transfer ✓

② Parity Check

Even parity = total number of 1's is EVEN ‖ Odd parity = total number of 1's is ODD
  • The exam tells you which parity the system uses. Count only the 1's — zeros don't matter.
  • A parity bit is added to the data so the number of 1's becomes even/odd. It doesn't change the data. e.g. 7-bit data with even number of 1's already → parity bit 0; odd → parity bit 1.
  • If the receiver finds the wrong count (a bit flipped by e.g. a magnetic field), the byte was transmitted incorrectly.
Parity Q5 (a)even parity · tick correct / incorrect

A system uses even parity. Tick whether each received byte was transmitted correctly or incorrectly.

Received byte number of 1's Transmitted correctly Transmitted incorrectly
11001000 3 (odd) ✓
01111100 5 (odd) ✓
01101001 4 (even) ✓

Answer: incorrect, incorrect, correct

Parity Q5 (b)parity block · find the corrupted bit

The word "FLOWCHART" was sent as 9 bytes (one per character) + a 10th parity byte. System uses even parity; column 1 is the parity bit. One bit was transmitted wrongly — give its byte number and column number.

Step 1: count 1's in every row (byte) → find the odd one. Step 2: count 1's in every column → find the odd one. Step 3: intersection = the wrong bit.

letter col 1 col 2 col 3 col 4 col 5 col 6 col 7 col 8 row 1's
byte 1 F 1 0 1 0 0 1 1 0 4 ✓
byte 2 L 1 0 1 0 1 1 0 0 4 ✓
byte 3 O 1 0 1 0 1 1 1 1 6 ✓
byte 4 W 1 0 1 1 0 1 1 1 6 ✓
byte 5 C 1 0 1 0 0 0 1 1 4 ✓
byte 6 H 0 0 1 0 1 0 0 0 2 ✓
byte 7 A 0 0 1 0 0 1 0 1 3 ✗
byte 8 R 1 0 1 1 0 0 1 0 4 ✓
byte 9 T 1 0 1 1 0 1 0 0 4 ✓
parity byte 1 0 1 1 1 1 1 0 6 ✓
col 1's 8 ✓ 0 ✓ 10 ✓ 4 ✓ 4 ✓ 7 ✗ 6 ✓ 4 ✓

Table as given in the paper (column 1 = parity bit, even parity). Counts shown on the right/bottom are my check; the teacher ticked bytes 1–6, crossed byte 7 and circled the bit.

rows: bytes 1–6 → 4,4,6,6,4,2 ones ✓ even byte 7 (A) → 3 ones ✗ odd ← wrong byte columns: only column 6 has an odd count (7 ones) ✗ intersection of byte 7 & column 6 (the circled 1, should have been 0) Byte number = 7   Column number = 6
Q: How can a parity block check identify a bit that has been corrupted?
  • Each byte has a parity bit (column 1 here)
  • An additional parity byte is sent, with vertical and horizontal parity
  • Each row and column must have an even / odd number of 1's (write whichever the question says)
  • Identify the incorrect row and column
  • The intersection is the error

③ Automatic Repeat Request (ARQ)

Note: ARQ was a ~6-mark question at — be ready for it in AS.
SenderReceiver data packet positive ACK (no error) ⇒ carry on ✓ data packet (error!) negative ACK ⇒ "please resend" sender RESENDS the packet timeout:no ACK ine.g. 5 s ⇒also resend
ARQ uses acknowledgement + timeout
Learn the wording:
• ARQ uses acknowledgement (a message sent to the receiver indicating that data has been received correctly) and timeout (time interval allowed to elapse before an acknowledgement is received).
• When the receiving device detects an error, it asks for the data packet to be resent.
• If no error is detected then a positive acknowledgement is sent.
• The sending device will resend the data if it receives a request to resend (negative acknowledgement) or a timeout has occurred.
Sir's example: I fix the timeout at 5 seconds — if no confirmation arrives within 5 s I send again; a positive ACK means no resending; a negative ACK means automatic resend. (Also seen in packet loss.)

6. Digital Signature & Hashing

Note: This part comes from the board only — the recorded lecture ends at ARQ, so the explanations below are built from the board notes.

Public and Private keys

Sender holds Receiver holds
own keys own private key + own public key own private key + own public key
other's key public key (of receiver) public key (of sender)
Remember: the sender encrypts the digest with his PRIVATE key; it can only be decrypted with the matching public key of the sender.

Hashing algorithm

Definition: Hashing algorithms are a mathematical function that produces a hash key (also called the digest).

number 0 5 4 1 9 7 2 2 + + + + 5 5 16 4 + + 10 20 + 30
add digits in pairs, then again, until one value is left: hash key = 30

Board example: 0+5 = 5, 4+1 = 5, 9+7 = 16, 2+2 = 4 → 5+5 = 10, 16+4 = 20 → 10+20 = 30. (The email flow below uses an illustrative digest of 54.) Same input + same algorithm ⇒ same hash; change the data and the hash changes.

SENDER Emailmessage Hashingalgorithm Digest(hash key 54) Encrypt digest withsender's PRIVATE key DIGITALSIGNATURE sent with the email ↓ RECEIVER Digitalsignature Decrypt withsender's PUBLIC key DigestA = 54 Emailreceived SAME hashingalgorithm DigestB = 54 A = B ?same ⇒ authentic ✓& NOT altered ✓
digital signature = hash of the message, locked with the sender's private key
Q: Explain how a digital signature is used to ensure an email is authentic?
  • Email message is put through a hashing algorithm to produce a digest
  • Digest is encrypted with the sender's private key to create the digital signature
  • The digital signature can only be decrypted with the matching sender's public key (⇒ proves it came from the sender)
Q: Explain how a digital signature is used to ensure the data is not altered?
  • Email message put through the agreed hashing algorithm to produce a digest
  • Digest is encrypted (with the message) by the sender's private key to create the digital signature
  • The digital signature (and message) is decrypted with the public key of the sender
  • Receiver then passes the email through the same hashing algorithm and produces a digest
  • The digest received from the sender is matched with the digest of the receiver
  • If both digests are the same then the data is not altered

Quick Recap — Full Chapter Cheat-Sheet

✓ Terms & security measures
  • Integrity = valid / same as sent · Privacy = authorized only · Security = no data loss
  • Encryption: scramble · encryption key · meaningless · decryption key
  • Backup: copy stored elsewhere → restore · Mirroring: 2 disks simultaneously
  • Firewall: monitors in/out traffic, blocks unauthorized, allow list, software/hardware
  • User account: username + password · Access rights: individual/group, no editing program
  • Anti-malware: scan, quarantine/delete, scheduled · Physical: locked doors/keyboards
  • Online: up-to-date anti-virus, proxy server (hides IP), strong biometrics/password
  • Backup factors: how often · medium · where · what · when (+ example each)
✓ Malware
  • Virus – needs host, replicates → anti-virus · Worm – standalone, no host, eats bandwidth → AV, OS update, disconnect
  • Logic bomb – triggers on condition/date · Trojan – disguised as legit software · Spyware – monitors keys, sends back → anti-spyware / on-screen keyboard
  • Phishing – email → fake site (train, ignore) · Pharming – installed code redirects to fake site
✓ Data integrity
  • Validation = reasonable: range · format · length · presence · existence · limit
  • Verification = same as original. Entry: double entry (2 people), visual check, check digit. Transfer: checksum, parity, ARQ
  • Check digit: weights (n…1 from left) → multiply & add → ÷11 → 11 − remainder (4156710 → 106 → rem 7 → 4)
  • Checksum: add blocks, send result, receiver repeats & compares (real life: 1's complement → receiver gets all 1's)
  • Parity: count 1's · even/odd · block → odd row ∩ odd column = error (byte 7, col 6) · ARQ: ACK + timeout, resend on NACK/timeout
  • Digital signature: hash → digest → encrypt with sender's private key → receiver decrypts with public key, re-hashes, compares digests