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
| Aspect | Security | Privacy | Integrity |
|---|---|---|---|
| Primary concern | Unauthorised access | Personal data rights | Data correctness |
| Threats | Hackers, malware | Misuse of personal data | Corruption, errors |
| Protection methods | Encryption, firewalls | Consent, anonymisation | Validation, checksums |
| Example | Stopping hacker stealing data | Asking permission to use email | Ensuring 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 Layer | What it protects |
|---|---|
| Computer System | Banking servers, network infrastructure |
| Data Security | Account balances, transaction records |
| Both needed | If 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:
| Type | How it works | Accuracy | Uses |
|---|---|---|---|
| Fingerprint | Scans ridge patterns | High | Phones, laptops, door access |
| Facial recognition | Analyses face geometry | Medium-High | Phones, surveillance |
| Iris scan | Analyses iris patterns | Very high | High security areas |
| Voice recognition | Analyses voice patterns | Medium | Phone banking, smart speakers |
| Retina scan | Scans blood vessel pattern | Very high | Military, research |
| Hand geometry | Measures hand shape | Medium | Building 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:
| Type | Description | Example |
|---|---|---|
| Packet filtering | Examines packets; allows/blocks based on IP, port, protocol | Basic router firewall |
| Stateful inspection | Tracks connection state; more sophisticated | Enterprise firewalls |
| Application-level gateway (proxy) | Filters specific applications | Web proxy |
| Next-generation firewall | Deep packet inspection, intrusion prevention | Modern 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:
| Method | Description | Advantages | Disadvantages |
|---|---|---|---|
| Signature-based | Matches files against known virus patterns | Accurate for known threats | Misses new viruses; needs updates |
| Heuristic analysis | Looks for suspicious behaviour | Can detect new variants | False positives |
| Behavioural monitoring | Monitors program actions | Detects zero-day attacks | Resource intensive |
| Sandboxing | Runs suspicious code in isolated environment | Safe analysis | Slows 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:
| Type | Description | Example | Use case |
|---|---|---|---|
| Symmetric | Same key for encryption/decryption | AES, DES, 3DES | File encryption, disk encryption |
| Asymmetric | Public/private key pair | RSA, ECC | SSL/TLS, email encryption |
Applications:
| Application | What is encrypted | Purpose |
|---|---|---|
| Full disk encryption | Entire hard drive | Protect data if device stolen |
| File/folder encryption | Specific files | Additional security for sensitive data |
| Email encryption | Email content | Confidential communication |
| HTTPS | Web traffic | Secure browsing |
| VPN | All network traffic | Privacy on public networks |
| Database encryption | Database contents | Protect 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:
| Type | Description | Motivation |
|---|---|---|
| White hat | Ethical hackers; find vulnerabilities to help | Improve security |
| Black hat | Malicious hackers; break in illegally | Profit, damage, notoriety |
| Grey hat | Between; may break in but not maliciously | Personal challenge |
| Script kiddie | Uses existing tools without deep knowledge | Thrill seeking |
| Hacktivist | Hacks for political/social causes | Promote agenda |
| State-sponsored | Employed by governments | Espionage, 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:
- Attacker sends communication (email, text, message)
- Appears to be from legitimate organisation (bank, PayPal, HMRC)
- Creates urgency (account suspended, unusual activity)
- Contains link to fake website
- Victim enters credentials on fake site
- Attacker steals information
Types of phishing:
| Type | Description | Example |
|---|---|---|
| Email phishing | Mass emails to many targets | “Your account needs verification” |
| Spear phishing | Targeted at specific individual | “HR: Update your details” |
| Whaling | Targets high-profile executives | “CEO: Urgent wire transfer” |
| Smishing | SMS/text message phishing | “Your package delivery failed” |
| Vishing | Voice call phishing | Fake 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
- Attacker compromises DNS server
- Changes legitimate domain (bank.com) to point to fake IP
- All users of that DNS server redirected to fake site
- Browser shows correct URL but wrong site
Method 2: Hosts file modification
- Malware modifies computer’s hosts file
- bank.com now points to fake IP
- 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
| Threat | Description |
|---|---|
| Denial of Service (DoS) | Overwhelms system with traffic, making it unavailable |
| Distributed DoS (DDoS) | DoS from many sources simultaneously |
| Man-in-the-Middle | Attacker intercepts communication between two parties |
| Ransomware | Encrypts data and demands payment for decryption |
| Trojan | Malware disguised as legitimate software |
| Worm | Self-replicating malware that spreads automatically |
| Rootkit | Hides malware deep in system (often kernel level) |
| Keylogger | Records keystrokes |
| Zero-day exploit | Attacks 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
| Measure | What it prevents |
|---|---|
| Regular software updates | Known vulnerabilities |
| Strong password policy | Unauthorised access |
| Multi-factor authentication | Stolen credentials |
| Employee training | Phishing, social engineering |
| Principle of least privilege | Insider threats, malware spread |
| Network segmentation | Lateral movement of attackers |
| Regular backups | Ransomware, data loss |
| Incident response plan | Minimise damage when breached |
| Security audits | Identify weaknesses |
| Physical security | Theft 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:
| Level | Permissions | Example |
|---|---|---|
| Read | View file contents | Users reading documentation |
| Write | Modify file contents | Editors updating documents |
| Execute | Run program | Users running application |
| Delete | Remove file | Administrators cleaning up |
| Full control | All permissions + change permissions | System 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
| Aspect | Validation | Verification |
|---|---|---|
| Purpose | Check data is sensible/valid | Check data matches source |
| Timing | Before acceptance | After entry/transfer |
| Prevents | Invalid data entry | Transcription/transfer errors |
| Example | Age cannot be 200 | Re-enter email to confirm |
| Automation | Usually automatic | Can 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:
- Original number has check digit calculated using algorithm
- Check digit appended to number
- When number entered, algorithm recalculates check digit
- 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):
- Double every second digit from right
- If doubling results in >9, add digits (e.g., 16 → 1+6=7)
- Sum all digits
- 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:
- Divide data into fixed-size blocks (e.g., 16-bit words)
- Sum all blocks (ignoring overflow)
- Transmit sum with data
- 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
| Method | Detects | Can correct? | Overhead | Use case |
|---|---|---|---|---|
| Visual check | Transcription errors | Manual | Time | Critical data entry |
| Double entry | Typing errors | No (re-enter) | 2× entry | Passwords, financial |
| Single parity | Odd bit errors | No | 1 bit | Simple serial communication |
| Block parity | Multiple errors; locates single | Yes (single bit) | More bits | Memory (ECC RAM) |
| Checksum | Many errors | No | 16/32 bits | Network packets |
| CRC | Very good detection | No | 16/32 bits | Storage, networks |
| Hash (MD5/SHA) | Excellent detection | No | 128-512 bits | File 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
