Chapter 6: Security, Privacy and Data Integrity – 9618 CS AS Level Notes

6.1 Data Security


Security vs Privacy vs Integrity

Data Security

Definition: Protection of data from unauthorised access, use, disclosure, disruption, modification, or destruction.

Key aspects:

  • Confidentiality: Only authorised users can access data
  • Availability: Data is accessible when needed
  • Access control: Who can do what with data

Focus: Protecting data from threats (external and internal)

Data Privacy

Definition: The right of individuals to control how their personal information is collected, used, shared, and stored.

Key aspects:

  • Consent: Individuals must agree to data collection
  • Purpose limitation: Data used only for stated purpose
  • Data minimisation: Only collect what’s necessary
  • Individual rights: Access, correction, deletion

Focus: Ethical and legal handling of personal information

Data Integrity

Definition: The accuracy, consistency, and trustworthiness of data throughout its lifecycle.

Key aspects:

  • Accuracy: Data correctly represents real-world values
  • Consistency: Data remains unchanged during processing/transfer
  • Validity: Data conforms to defined rules and formats
  • Completeness: No missing or corrupted data

Focus: Maintaining correctness and reliability of data

Comparison

AspectSecurityPrivacyIntegrity
Primary concernUnauthorised accessPersonal data rightsData correctness
ThreatsHackers, malwareMisuse of personal dataCorruption, errors
Protection methodsEncryption, firewallsConsent, anonymisationValidation, checksums
ExampleStopping hacker stealing dataAsking permission to use emailEnsuring bank balance is correct

Relationship Between Them

                    ┌─────────────────┐
                    │    Security     │
                    │  (protects all  │
                    │     data)       │
                    └────────┬────────┘
                             │
              ┌──────────────┼──────────────┐
              │              │              │
              ↓              ↓              ↓
    ┌─────────────┐  ┌─────────────┐  ┌─────────────┐
    │   Privacy   │  │  Integrity  │  │   Other     │
    │(personal data│  │(all data)   │  │  aspects    │
    └─────────────┘  └─────────────┘  └─────────────┘

Example: Medical records

  • Security: Prevent unauthorised access to records
  • Privacy: Patient controls who sees their records
  • Integrity: Ensure dosage information is correct

Need for Security of Data and Computer Systems

Why Secure Both?

Data Security alone is insufficient because data exists within computer systems.

Computer System Security protects the infrastructure:

  • Hardware (servers, workstations, network devices)
  • Software (OS, applications)
  • Network connections

Data Security protects the information itself:

  • Files and databases
  • Communications
  • Backups

Interdependence

Computer System Security         Data Security
    ┌──────────────┐             ┌──────────────┐
    │ Firewalls    │◄───────────►│ Encryption   │
    │ Antivirus    │◄───────────►│ Access rights│
    │ User accounts│◄───────────►│ Backups      │
    │ Updates      │◄───────────►│ Validation   │
    └──────────────┘             └──────────────┘

If system security fails:

  • Hackers can bypass data security measures
  • Malware can corrupt or steal data
  • System crash can destroy data

If data security fails:

  • Even secure systems may leak information
  • Insiders can misuse access
  • Data corruption may go undetected

Real-World Example: Online Banking

Security LayerWhat it protects
Computer SystemBanking servers, network infrastructure
Data SecurityAccount balances, transaction records
Both neededIf server hacked → data stolen; if data corrupted → wrong balances

Security Measures for Computer Systems

User Accounts

Purpose: Identify and authenticate users accessing the system.

Types:

  • Administrator/root: Full system access
  • Standard user: Limited access (cannot install software, change system settings)
  • Guest: Very limited, temporary access

Best practices:

  • Principle of least privilege (users get minimum access needed)
  • Regular review of accounts (remove unused)
  • Disable default accounts
  • Strong password policies

Passwords

Purpose: Authenticate user identity (something you know).

Characteristics of strong passwords:

  • Minimum length (8+ characters)
  • Mix of uppercase, lowercase, numbers, symbols
  • Not dictionary words
  • Not personal information (birthdays, names)
  • Changed regularly
  • Not reused across different systems

Password storage best practices:

  • Never store plaintext passwords
  • Use salting + hashing (bcrypt, PBKDF2, Argon2)
  • Rate limiting on login attempts

Weaknesses:

  • Can be guessed or brute-forced
  • Users choose weak passwords
  • Can be stolen (phishing, keyloggers)
  • Written down or shared

Authentication Techniques

Something you know:

  • Passwords, PINs, security questions

Something you have:

  • Smart cards, tokens, phone (2FA)
  • Hardware security keys (YubiKey)

Something you are (Biometrics):

  • Fingerprint scanners
  • Facial recognition
  • Iris scans
  • Voice recognition
  • Retina scans
  • Hand geometry

Somewhere you are:

  • Geolocation, IP address checking

Multi-Factor Authentication (MFA):
Combines two or more methods (e.g., password + fingerprint + phone)

Digital Signatures

Purpose: Verify authenticity and integrity of digital messages/documents.

How they work:

Sender:
1. Hash document → digest
2. Encrypt digest with private key → signature
3. Send document + signature

Receiver:
1. Hash received document → digest2
2. Decrypt signature with sender's public key → digest1
3. If digest1 = digest2, document authentic and unchanged

Properties:

  • Authentication: Proves sender’s identity
  • Non-repudiation: Sender cannot deny sending
  • Integrity: Detects any changes

Applications:

  • Software distribution (signed drivers)
  • Email signing (PGP, S/MIME)
  • Digital contracts
  • Code signing certificates

Biometrics

Purpose: Authenticate using unique physical characteristics.

Common types:

TypeHow it worksAccuracyUses
FingerprintScans ridge patternsHighPhones, laptops, door access
Facial recognitionAnalyses face geometryMedium-HighPhones, surveillance
Iris scanAnalyses iris patternsVery highHigh security areas
Voice recognitionAnalyses voice patternsMediumPhone banking, smart speakers
Retina scanScans blood vessel patternVery highMilitary, research
Hand geometryMeasures hand shapeMediumBuilding access

Advantages:

  • Cannot be forgotten or lost
  • Difficult to forge
  • Convenient (nothing to carry)

Disadvantages:

  • Cannot be changed if compromised
  • Privacy concerns
  • False acceptance/rejection rates
  • Cost of hardware
  • Health/sanitation concerns (fingerprint scanners)

Firewall

Purpose: Monitors and controls incoming/outgoing network traffic based on security rules.

Types:

TypeDescriptionExample
Packet filteringExamines packets; allows/blocks based on IP, port, protocolBasic router firewall
Stateful inspectionTracks connection state; more sophisticatedEnterprise firewalls
Application-level gateway (proxy)Filters specific applicationsWeb proxy
Next-generation firewallDeep packet inspection, intrusion preventionModern corporate firewalls

What firewalls can block:

  • Unauthorised incoming connections
  • Specific ports/services
  • Certain IP addresses/ranges
  • Suspicious outgoing traffic (malware calling home)

Where firewalls are used:

  • Personal: Software firewall on PC (Windows Firewall)
  • Network: Hardware firewall at network perimeter
  • Cloud: Virtual firewalls in cloud environments

Rule example:

ALLOW TCP 192.168.1.0/24 ANY 80,443  (web access for LAN)
DENY TCP ANY ANY 22                   (block SSH from outside)
ALLOW UDP 10.0.0.1 53 ANY             (allow DNS from specific server)

Anti-Virus Software

Purpose: Detects, prevents, and removes malicious software.

Detection methods:

MethodDescriptionAdvantagesDisadvantages
Signature-basedMatches files against known virus patternsAccurate for known threatsMisses new viruses; needs updates
Heuristic analysisLooks for suspicious behaviourCan detect new variantsFalse positives
Behavioural monitoringMonitors program actionsDetects zero-day attacksResource intensive
SandboxingRuns suspicious code in isolated environmentSafe analysisSlows execution

Features:

  • Real-time scanning (on file access)
  • Scheduled scans
  • Email scanning
  • Web protection
  • Quarantine management
  • Automatic updates

Limitations:

  • Cannot protect against all threats
  • Needs constant updates
  • May slow system
  • Can be disabled by sophisticated malware

Anti-Spyware

Purpose: Specifically targets spyware (software that secretly monitors user activity).

What spyware does:

  • Records keystrokes (keyloggers)
  • Captures screenshots
  • Steals login credentials
  • Monitors browsing habits
  • Collects personal information

Anti-spyware features:

  • Browser cleanup (remove toolbars, extensions)
  • Tracking cookie removal
  • Browser hijacker detection
  • Real-time protection

Often combined with antivirus (modern security suites include both)

Encryption

Purpose: Converts readable data (plaintext) into unreadable format (ciphertext) using an algorithm and key.

Types:

TypeDescriptionExampleUse case
SymmetricSame key for encryption/decryptionAES, DES, 3DESFile encryption, disk encryption
AsymmetricPublic/private key pairRSA, ECCSSL/TLS, email encryption

Applications:

ApplicationWhat is encryptedPurpose
Full disk encryptionEntire hard driveProtect data if device stolen
File/folder encryptionSpecific filesAdditional security for sensitive data
Email encryptionEmail contentConfidential communication
HTTPSWeb trafficSecure browsing
VPNAll network trafficPrivacy on public networks
Database encryptionDatabase contentsProtect stored data

Example: HTTPS encryption

User ────[encrypted]────> Website
        (cannot read)
Hacker ──[sees gibberish]─>

Threats to Computer and Data Security

Malware (Malicious Software)

Definition: Software designed to harm, exploit, or otherwise compromise a computer system.

Virus

Characteristics:

  • Self-replicating code that attaches to clean files
  • Spreads when infected file is executed
  • Requires human action to spread (opening file, running program)
  • Can corrupt data, damage system, steal information

Types:

  • File infector: Attaches to executable files
  • Boot sector: Infects boot sector of disks
  • Macro virus: In documents (Word, Excel macros)
  • Polymorphic virus: Changes code to avoid detection

Infection vectors:

  • Email attachments
  • Downloaded files
  • Infected software
  • Removable drives (USB)

Spyware

Characteristics:

  • Secretly monitors user activity
  • Collects and transmits information without consent
  • Often installed with other software (bundling)
  • Runs in background, hard to detect

What spyware collects:

  • Keystrokes (keyloggers)
  • Browsing history
  • Login credentials
  • Credit card numbers
  • Personal documents

Signs of infection:

  • Slow performance
  • Unexpected pop-ups
  • Changed browser homepage
  • New toolbars

Hackers

Definition: Individuals who attempt to gain unauthorised access to computer systems.

Types:

TypeDescriptionMotivation
White hatEthical hackers; find vulnerabilities to helpImprove security
Black hatMalicious hackers; break in illegallyProfit, damage, notoriety
Grey hatBetween; may break in but not maliciouslyPersonal challenge
Script kiddieUses existing tools without deep knowledgeThrill seeking
HacktivistHacks for political/social causesPromote agenda
State-sponsoredEmployed by governmentsEspionage, warfare

Common hacking techniques:

  • Password cracking (brute force, dictionary attacks)
  • Exploiting unpatched vulnerabilities
  • Social engineering
  • Man-in-the-middle attacks
  • SQL injection
  • Cross-site scripting (XSS)

Phishing

Definition: Fraudulent attempt to obtain sensitive information by disguising as trustworthy entity.

How it works:

  1. Attacker sends communication (email, text, message)
  2. Appears to be from legitimate organisation (bank, PayPal, HMRC)
  3. Creates urgency (account suspended, unusual activity)
  4. Contains link to fake website
  5. Victim enters credentials on fake site
  6. Attacker steals information

Types of phishing:

TypeDescriptionExample
Email phishingMass emails to many targets“Your account needs verification”
Spear phishingTargeted at specific individual“HR: Update your details”
WhalingTargets high-profile executives“CEO: Urgent wire transfer”
SmishingSMS/text message phishing“Your package delivery failed”
VishingVoice call phishingFake tech support calls

Red flags:

  • Generic greetings (“Dear Customer”)
  • Spelling/grammar errors
  • Suspicious sender email address
  • Urgent/threatening language
  • Hover over links (shows different URL)
  • Requests for personal information

Pharming

Definition: Redirecting users from legitimate website to fake one without their knowledge.

How it works:

Method 1: DNS poisoning

  1. Attacker compromises DNS server
  2. Changes legitimate domain (bank.com) to point to fake IP
  3. All users of that DNS server redirected to fake site
  4. Browser shows correct URL but wrong site

Method 2: Hosts file modification

  1. Malware modifies computer’s hosts file
  2. bank.com now points to fake IP
  3. User types correct URL but goes to fake site

Comparison with phishing:

  • Phishing: User tricked into clicking fake link
  • Pharming: User types correct address but still redirected

Protection:

  • Use secure DNS servers
  • Keep hosts file protected
  • Look for HTTPS (green padlock)
  • Check certificates

Other Threats

ThreatDescription
Denial of Service (DoS)Overwhelms system with traffic, making it unavailable
Distributed DoS (DDoS)DoS from many sources simultaneously
Man-in-the-MiddleAttacker intercepts communication between two parties
RansomwareEncrypts data and demands payment for decryption
TrojanMalware disguised as legitimate software
WormSelf-replicating malware that spreads automatically
RootkitHides malware deep in system (often kernel level)
KeyloggerRecords keystrokes
Zero-day exploitAttacks unknown, unpatched vulnerability

Methods to Restrict Risks

Risk Restriction Strategies

1. Prevention

  • Stop threats before they occur
  • Examples: Firewalls, access controls, user training

2. Detection

  • Identify threats that occur
  • Examples: Intrusion detection systems, log monitoring

3. Response

  • Act when threats detected
  • Examples: Incident response plans, isolation of infected systems

4. Recovery

  • Restore after successful attack
  • Examples: Backups, disaster recovery plans

Practical Risk Restriction Measures

MeasureWhat it prevents
Regular software updatesKnown vulnerabilities
Strong password policyUnauthorised access
Multi-factor authenticationStolen credentials
Employee trainingPhishing, social engineering
Principle of least privilegeInsider threats, malware spread
Network segmentationLateral movement of attackers
Regular backupsRansomware, data loss
Incident response planMinimise damage when breached
Security auditsIdentify weaknesses
Physical securityTheft of devices

Security Methods to Protect Data

Encryption (for Data)

Data at rest:

  • Full disk encryption (BitLocker, FileVault)
  • File/folder encryption (EFS, VeraCrypt)
  • Database encryption (TDE)
  • Removable media encryption (encrypted USB)

Data in transit:

  • TLS/SSL (HTTPS)
  • VPN
  • SSH
  • Encrypted email (PGP)

Data in use:

  • Memory encryption (limited)
  • Homomorphic encryption (emerging)

Access Rights / Permissions

Purpose: Control who can do what with data.

Access levels:

LevelPermissionsExample
ReadView file contentsUsers reading documentation
WriteModify file contentsEditors updating documents
ExecuteRun programUsers running application
DeleteRemove fileAdministrators cleaning up
Full controlAll permissions + change permissionsSystem administrators

Implementation methods:

Discretionary Access Control (DAC):

  • Owners control their files
  • Windows file permissions
  • Linux chmod

Mandatory Access Control (MAC):

  • System-enforced policies
  • SELinux, AppArmor
  • Multi-level security

Role-Based Access Control (RBAC):

  • Permissions assigned to roles
  • Users assigned to roles
  • Common in organisations

Access Control Lists (ACL):

File: payroll.xlsx
User A: Read
User B: Read/Write
Group HR: Read/Write
Group Everyone: No access

User authentication:

  • Username/password
  • Biometrics
  • Security tokens

Benefits of access rights:

  • Prevents unauthorised access
  • Limits damage from compromised accounts
  • Enforces separation of duties
  • Supports data confidentiality

6.2 Data Integrity

Data Validation vs Data Verification

Data Validation

Definition: Checking that data meets certain rules or constraints before it is accepted into a system.

Purpose: Prevent invalid data from entering the system.

When it occurs: At data entry time.

Focus: Is the data reasonable and in the correct format?

Data Verification

Definition: Checking that data matches the original source after it has been entered or transferred.

Purpose: Ensure data has been entered or transferred correctly.

When it occurs: After data entry or during/after transfer.

Focus: Is the data accurate compared to the source?

Comparison

AspectValidationVerification
PurposeCheck data is sensible/validCheck data matches source
TimingBefore acceptanceAfter entry/transfer
PreventsInvalid data entryTranscription/transfer errors
ExampleAge cannot be 200Re-enter email to confirm
AutomationUsually automaticCan be manual or automatic

Data Validation Methods

Range Check

Definition: Checks if data falls within a specified range of acceptable values.

Examples:

  • Age must be between 0 and 130
  • Temperature between -50°C and +50°C
  • Exam mark between 0 and 100

Code example (validation logic):

IF age >= 0 AND age <= 130 THEN
    accept
ELSE
    error "Age must be between 0 and 130"
ENDIF

Format Check

Definition: Checks if data follows a specified pattern or template.

Examples:

  • Email must contain @ and .
  • Postcode must follow specific pattern (e.g., LLNN NLL for UK)
  • Phone number must have 11 digits
  • Date must be DD/MM/YYYY

Regular expression examples:

  • Email: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
  • UK Postcode: ^[A-Z]{1,2}[0-9][A-Z0-9]? ?[0-9][A-Z]{2}$

Length Check

Definition: Checks that data has the required number of characters.

Examples:

  • Password must be at least 8 characters
  • Username maximum 20 characters
  • Postcode exactly 8 characters (including space)
  • Telephone number between 10-15 digits

Code example:

IF LENGTH(password) >= 8 THEN
    accept
ELSE
    error "Password too short"
ENDIF

Presence Check

Definition: Checks that data has actually been entered (not left blank).

Examples:

  • Name field cannot be empty
  • Email address required
  • Terms and conditions must be accepted

Code example:

IF field IS NOT EMPTY THEN
    accept
ELSE
    error "This field is required"
ENDIF

Existence Check

Definition: Checks that a value exists in a reference table or database.

Examples:

  • Department code exists in departments table
  • Product ID exists in products database
  • Country code is valid

Code example:

SELECT COUNT(*) FROM departments WHERE dept_code = input
IF count > 0 THEN
    accept
ELSE
    error "Invalid department code"
ENDIF

Limit Check

Definition: Similar to range check but checks only one boundary (upper or lower limit).

Examples:

  • Stock level cannot go below 0 (lower limit)
  • Maximum order quantity 100 (upper limit)
  • Minimum order value £10 (lower limit)

Code example:

IF quantity <= 100 THEN
    accept
ELSE
    error "Maximum order quantity is 100"
ENDIF

Check Digit

Definition: A calculated digit appended to a number to detect errors in data entry/transmission.

How it works:

  1. Original number has check digit calculated using algorithm
  2. Check digit appended to number
  3. When number entered, algorithm recalculates check digit
  4. If calculated ≠ appended, error detected

Common algorithms:

Modulo 10 (ISBN-13 example):

Number: 978034098382
Positions: 1  2  3  4  5  6  7  8  9  10 11 12
Multiply:  1  3  1  3  1  3  1  3  1  3  1  3
Result:    9 21  8  0  3  0  9 24  8  0  3  6
Sum = 91
91 mod 10 = 1
Check digit = (10 - 1) mod 10 = 9
Complete number: 9780340983829

ISBN-10 example:

Number: 034098382
Multiply each digit by position (10 down to 1):
0×10 + 3×9 + 4×8 + 0×7 + 9×6 + 8×5 + 3×4 + 8×3 + 2×2
= 0 + 27 + 32 + 0 + 54 + 40 + 12 + 24 + 4 = 193
193 mod 11 = 6
Check digit = 11 - 6 = 5
Complete: 0340983825

Credit Card (Luhn algorithm):

  1. Double every second digit from right
  2. If doubling results in >9, add digits (e.g., 16 → 1+6=7)
  3. Sum all digits
  4. Check digit makes total divisible by 10

Applications:

  • ISBN (books)
  • Credit card numbers
  • National ID numbers
  • Barcodes (EAN-13, UPC)

Data Verification Methods

During Data Entry

Visual Check / Double Entry

Visual Check (Screen Check):

  • User reviews entered data on screen before final submission
  • Compares with original source document
  • Manual process, prone to human error
  • Example: Confirmation screen showing entered details

Double Entry:

  • Data entered twice, preferably by different people
  • System compares both entries
  • If they match, data accepted
  • If different, error flagged
  • Very effective for critical data

Example: Creating new user account

First entry: email@example.com
Second entry: email@example.com
System compares → match → accepted

Applications:

  • Creating passwords (enter twice)
  • Financial data entry
  • Research data input
  • Medical records

During Data Transfer

Parity Check

Purpose: Detect errors during data transmission.

Simple (Single) Parity Check:

Even parity: Number of 1s in data + parity bit = even
Odd parity: Number of 1s in data + parity bit = odd

Example (even parity):

Data: 1011001 (4 ones → even already)
Parity bit: 0
Transmitted: 10110010

Data: 1101011 (5 ones → odd)
Parity bit: 1 (to make even)
Transmitted: 11010111

Error detection:

Received: 10110011 (5 ones → odd, but even parity expected)
Error detected!

Limitations:

  • Can only detect odd number of bit errors
  • Cannot correct errors (only detect)
  • If two bits flip, parity remains same → error undetected

Block Parity Checks

Purpose: Improve error detection by organising data into blocks.

How it works:

Data arranged in rows and columns
Parity calculated for each row AND each column

Example 4×4 block:
Data:   1 0 1 1
        0 1 0 1
        1 1 0 0
        0 0 1 0

Row parity:   1 0 1 1 | 1 (row parity)
              0 1 0 1 | 0
              1 1 0 0 | 0
              0 0 1 0 | 1
Column parity:0 0 0 0

Transmit all data + row parity + column parity

Advantages:

  • Can locate which bit is in error (intersection of bad row and bad column)
  • Better detection than single parity

Checksum

Purpose: Verify integrity of data block using calculated sum.

How it works:

Simple checksum:

  1. Divide data into fixed-size blocks (e.g., 16-bit words)
  2. Sum all blocks (ignoring overflow)
  3. Transmit sum with data
  4. Receiver recalculates sum and compares

Example:

Data: 10101100 11010011 01110101
Blocks:   172      211      117
Sum = 172 + 211 + 117 = 500 (or use 8-bit wrap)
Transmit data + checksum (500)

Cyclic Redundancy Check (CRC):

  • More sophisticated than simple sum
  • Treats data as polynomial
  • Divides by predetermined polynomial
  • Remainder is CRC value
  • Very good at detecting common errors
  • Used in network protocols (Ethernet, Wi-Fi)

MD5/SHA hashes:

  • Cryptographic hash functions
  • Produce fixed-size hash from any data
  • Very low collision probability
  • Used for file integrity verification

Applications:

  • Network packet integrity (TCP checksum)
  • File download verification (MD5/SHA)
  • Storage systems (RAID)
  • Version control (Git uses SHA-1)

Verification Methods Comparison

MethodDetectsCan correct?OverheadUse case
Visual checkTranscription errorsManualTimeCritical data entry
Double entryTyping errorsNo (re-enter)2× entryPasswords, financial
Single parityOdd bit errorsNo1 bitSimple serial communication
Block parityMultiple errors; locates singleYes (single bit)More bitsMemory (ECC RAM)
ChecksumMany errorsNo16/32 bitsNetwork packets
CRCVery good detectionNo16/32 bitsStorage, networks
Hash (MD5/SHA)Excellent detectionNo128-512 bitsFile verification

Summary Checklist for Assessment Objectives

AO1 (Knowledge) – You should be able to:

  • ✓ Define security, privacy, integrity and explain differences
  • ✓ Explain need for both system and data security
  • ✓ List security measures (user accounts, passwords, biometrics, firewalls, antivirus, etc.)
  • ✓ Describe threats (malware types, hackers, phishing, pharming)
  • ✓ Define validation and verification
  • ✓ List validation methods (range, format, length, presence, existence, limit, check digit)
  • ✓ List verification methods (visual, double entry, parity, checksum)

AO2 (Application) – You should be able to:

  • ✓ Apply appropriate security measures for given scenarios
  • ✓ Identify threats from described situations
  • ✓ Recommend risk restriction methods
  • ✓ Apply validation checks to data
  • ✓ Calculate parity bits
  • ✓ Verify using checksums
  • ✓ Apply check digit algorithms

AO3 (Design/Evaluation) – You should be able to:

  • ✓ Evaluate security requirements for different systems
  • ✓ Compare security measures and justify choices
  • ✓ Assess threat impact and prioritise protections
  • ✓ Design validation rules for data entry forms
  • ✓ Evaluate verification methods for different situations
  • ✓ Judge effectiveness of security implementations

Scroll to Top