Security & Data Integrity
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 |
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.
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
- 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
② 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
③ Disk Mirroring
- The data is stored on two disks simultaneously
- If the first data disk drive fails, the data is accessed from the second disk
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
- 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
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
⑥ Anti-Malware
- Scans for malicious code (= harmful code)
- Quarantines or deletes any malicious software found
- Scans can be scheduled at regular intervals
⑦ Access Rights
- Different access rights for individual / group
- To stop users from editing the program
⑧ Physical Measures
- Locked doors / keyboards
- Secure method of access
- 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
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).
| 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.) |
3. Malware
Definition: Malware is software that is intentionally designed to cause damage to a computer or server.
Types of malware: viruses, worms, logic bombs, trojan horses, spyware
- 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)
- 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)
(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.
(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.
(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.
(4) Trojan Horses
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.
Solution: Anti-spyware software. Also: avoid the physical keyboard — use an on-screen keyboard / touch screen, since a keylogger only records real key presses.
Phishing and Pharming
Two ways malware / fraud reaches you (O-level concept — revise!).
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.
Pharming: Malicious code installed on user's computer or web server. The code redirects the user to a fake website.
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 ✗ |
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 |
Check Digit — Calculating It
② 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
| 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 |
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
② Parity Check
- 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.
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
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.
- 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)
• 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.
6. Digital Signature & Hashing
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) |
Hashing algorithm
Definition: Hashing algorithms are a mathematical function that produces a hash key (also called the digest).
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.
- 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)
- 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
- 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)
- 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
- 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