Year 9 · Cybersecurity · Part D: Computers in the world

Cybersecurity

In one line

Cybersecurity protects computers and data. Most attacks trick people or use weak systems, so good defences cover both.

1

Use the CIA triad to say what an attack damages.

2

Tell the kinds of malware and social engineering apart, and name the defence for each.

3

Work out why a long password beats a short messy one, with the maths.

4

Encrypt and decrypt with Caesar, break it with frequency analysis, and explain why modern encryption is different.

5

Know the law in the UK and in Spain, and what makes ethical hacking legal.

MalwareSoftware written to cause harm.
PhishingA fake message that fishes for your details.
Brute forceTrying every possible password.
EncryptionScrambling data so only the key holder can read it.
FirewallBlocks network traffic that breaks its rules.
2FASomething you know + something you have.

The CIA triad: what are we protecting?

Before asking "how was it attacked?", ask "what did the attack break?" Security people use three words. Their first letters spell CIA (nothing to do with spies).

C I A Confidentialityonly the right people can see it Integritynot changed without permission Availabilityworks when needed your data
Every attack breaks at least one corner. Naming the corner tells you which defence you need.
CornerMeansBroken when…Defended by…
ConfidentialityOnly the right people see itMessages leak; someone reads your filesPasswords, encryption, access levels
IntegrityNot changed without permissionSomeone edits grades; malware corrupts filesAccess levels, hashing, backups
AvailabilityWorks when neededA website is flooded offline; ransomware locks filesBackups, firewalls, spare servers
▶

Which corner broke?

Malware: harmful software

Malware = malicious software. The types are named by how they spread and what they do.

Virusrides on a file; a person spreads it PC 1 ☣ 📎 file PC 2 someone opens or shares it Wormcopies itself over the network, alone PC 1 ☣ PC 2 ☣ PC 3 ☣ PC 4 ☣
The difference examiners want: a virus needs a person to move it; a worm moves by itself across a network.
TypeHow it worksPicture it asMain defence
VirusHides inside a file; spreads when people share or open itA cold from touching somethingAnti-malware; don't open unknown files
WormSpreads across networks on its own, using security holesA cold walking door to doorUpdates (patches); firewall
TrojanPretends to be useful, so you install it yourselfThe wooden horse of TroyOnly install from trusted stores
RansomwareEncrypts your files and demands payment for the keyA kidnapperOffline backups
SpywareSecretly records what you do or typeSomeone reading over your shoulderAnti-malware; permissions
?Why?

Why are backups the defence against ransomware? Ransomware breaks availability: your files are still there but locked. If a clean copy is kept somewhere the malware can't reach (offline, or in versioned cloud storage), you just restore it. Paying the criminals is not a defence: there is no guarantee you get the key.

Social engineering: hacking people

It's often easier to trick a person than to break a computer. Social engineering means getting someone to give away access or information. It works by pressing four buttons in our heads.

act beforeyou think ⏰ Urgency"Within 24 hours!" 🏛 Authority"This is IT / the bank" 😨 Fear"Your account is locked" 🎁 Curiosity / greed"You've won!" "Salaries.xlsx"
The best defence is a habit: when you feel rushed or scared by a message, stop and check it another way.
  1. Phishing: a fake email or text that looks official and leads to a fake login page. Spear phishing is aimed at one person, using real details about them.

  2. Blagging (pretexting): a made-up story on the phone or in person: "I'm from IT, I need your password to fix your account."

  3. Shoulder surfing: watching someone type a PIN or password.

  4. Baiting: leaving an infected USB stick labelled "Exam answers" where someone will find it and plug it in.

!Watch out

Phishing signs: urgency or threats, a sender address or link that is nearly right, a generic greeting ("Dear customer"), spelling mistakes, and any request for a password. A real company never asks for your password.

▶

Name the trick

Technical attacks: using weak systems

These attacks go after the computer, not the person. For each one, learn the idea and the defence. You don't need to know how to do them.

DDoS: a flood of fake requests serveroverloaded real user ✕ can't get in
DoS = one computer floods a server. DDoS = distributed: thousands of hijacked computers (a botnet) do it at once. It breaks availability.
AttackThe idea, in one lineBreaksDefence
Brute forceTry every possible password until one worksCLong passwords, lock-outs, 2FA
Dictionary attackTry common words and leaked passwords firstCDon't use real words alone; passphrases
DoS / DDoSFlood a server so real users can't get inAFirewalls, traffic filtering, spare servers
InterceptionRead data as it travels, e.g. on open Wi-FiCEncryption (HTTPS, VPN)
SQL injectionType database commands into a form box that trusts its inputC, IValidation, parameterised queries
Why SQL injection works: data and commands get mixed SELECT … WHERE name = ' user's typing ' Glued together, the database can't tell where the program's words end and the user's begin. Safe: send them separately SELECT … WHERE name = ? + the typing, as plain data
The fix (a parameterised query) keeps the user's text in its own box, so it can never become part of the command. Validation (Topic 14) adds a second layer.
e.g.Example

The textbook illustration is a login box where someone types ' OR '1'='1. Glued into the command, it turns "name equals what you typed" into "name equals nothing, or 1 equals 1", which is always true. That's why the program must never glue user text into a command.

Why length beats complexity: the maths

A brute-force attack tries every possible password. So the question is: how many possible passwords are there? It's the "patterns" rule from Topic 2 again, with more than 2 choices per position.

  1. A 4-digit PIN: each position has 10 choices (0–9).

  2. First digit: 10 choices. For each of those, the second digit has 10: 10 × 10 = 100 so far.

  3. All four: 10 × 10 × 10 × 10 = 10⁴ = 10,000 PINs.

  4. Lower-case letters: 26 choices each. 8 letters: 26⁸ ≈ 209 billion.

  5. A computer trying 1 billion guesses a second: 209,000,000,000 ÷ 1,000,000,000 ≈ 209 seconds. About 3½ minutes.

  6. Now 12 lower-case letters: 26¹² ≈ 95 quadrillion ÷ 1 billion ≈ 95 million seconds ≈ 3 years. Four more letters, 500,000 times longer.

Careful: every grid line is 1,000 times the one before, so a bar that is only a little longer means hugely more time. "Random words" counts whole words picked from a list of 7,776, which is how passphrase generators work.
▶

Passphrase meter

Type a made-up example, never a real password. Nothing is saved or sent.

★Remember

Length multiplies, symbols only add a bit. A long passphrase of random words (like purple-violin-tuesday-rain) beats a short messy one (like P@ss1!). Swapping o for 0 doesn't help: attackers try those swaps first.

Defences: layers, like an onion

No single defence stops everything. So we stack them. An attacker must get through every layer; we only need one to hold. This is called defence in depth.

DefenceWhat it doesStops…
Strong passwords + 2FASomething you know + something you have (a code on your phone)Brute force, stolen passwords
Lock-outsBlock login after 3–5 wrong triesBrute force
FirewallChecks network traffic against rules; blocks the restWorms, unwanted connections, some DoS
Anti-malwareScans files for known malware and suspicious behaviourViruses, trojans, spyware
Updates (patches)Fix security holes the makers foundWorms, exploits of old bugs
Access levelsEach user gets only what they need (students can read, not edit grades)Insiders changing data
EncryptionStolen data is unreadable without the keyInterception, stolen laptops
BackupsA clean copy to restoreRansomware, accidents
ValidationOnly accept input in the expected formSQL injection
Penetration testingHire permitted testers to find holes firstUnknown weaknesses
Training + physical securityTeach people the signs; locks, cameras, swipe cardsSocial engineering, theft
▶

Why 2FA works: step through a login

Encryption, starting with Caesar

Encryption turns readable plaintext into scrambled ciphertext using a key. Only someone with the key can turn it back. The oldest famous one is the Caesar cipher: shift every letter by the same amount.

Key = 3. Read down: each plain letter (top) becomes the letter below it. X, Y and Z wrap round to the start.
  1. Plaintext HELLO, key 3.

  2. H → K, E → H, L → O, L → O, O → R.

  3. Ciphertext KHOOR. To decrypt, shift back 3.

?Why?

Why "mod 26"? Letters are numbered 0 (A) to 25 (Z). Y is 24; 24 + 3 = 27, but there is no letter 27. Divide by 26 and keep the remainder: 27 mod 26 = 1 = B. Like a clock going past 12 (Topic 3's overflow is the same idea, with 256).

Breaking Caesar: frequency analysis

Caesar has only 25 useful keys, so you could just try them all. But there's a smarter trick, discovered by the Arab scholar al-Kindi about 1,100 years ago: some letters are much more common than others.

  1. In English, E is the most common letter (about 12%), then T, A, O.

  2. Caesar moves every letter by the same amount, so the shape of the letter counts moves too, just slid sideways.

  3. Count the letters in the ciphertext. Find the tallest bar. It's probably E in disguise.

  4. The distance from E to that letter is the key.

▶

Crack the message

This message was encrypted with a secret key. Slide the shift until the purple bars (the message) line up with the amber bars (normal English).

letters in the messagenormal English
!Watch out

Short messages may not follow the usual pattern. Frequency analysis needs enough text: a few sentences, not one word.

Modern encryption and hashing

Modern keys are huge numbers: 128 or 256 bits. A 256-bit key has 2²⁵⁶ possible values, a number with 78 digits. Trying them all would take longer than the age of the universe, even with every computer on Earth.

Symmetricone key does both jobs Ana 🔑 🔒 ciphertext Bea 🔑 Fast. Problem: how do they share the key safely? Public-keytwo keys that work as a pair Beaprivate key 🔑never shared gives everyone an open 🔓(her public key) Anasnaps Bea's 🔓shut on a message Anyone can lock. Only Bea can unlock. HTTPS uses this to share a symmetric key, then switches to fast symmetric.

Hashing: a one-way fingerprint

A hash function turns any data into a fixed-length fingerprint. The same input always gives the same hash, but you can't run it backwards.

Websites store the hash of your password, not the password. At login they hash what you type and compare. If the database leaks, the attacker gets fingerprints, not passwords.

▶

Tiny hash demo

A toy hash (not a real secure one) so you can see the idea: change one letter and the whole fingerprint changes.

Fingerprint
e.g.Exams

AQA and OCR GCSE need encryption as an idea and the Caesar cipher. Public-key, hashing and the maths behind them go beyond GCSE, but they explain the padlock in your browser (Topic 16).

The law, and what makes hacking ethical

The same action can be a crime or a job. The difference is permission. A penetration tester has a written contract saying exactly what they may test.

UK: Computer Misuse Act 1990Spain: Código Penal
Section 1: unauthorised access to a computer ("just looking" counts). Up to 2 years.Art. 197 bis: accessing a system without authorisation. 6 months to 2 years.
Section 2: unauthorised access with intent to commit a further crime. Up to 5 years.Usually charged together with the further crime.
Section 3: unauthorised acts that impair a computer (malware, deleting data, DoS). Up to 10 years.Arts. 264 and 264 bis: damaging data or stopping a system working. 6 months to 3 years, more if serious.
Section 3ZA: causing serious damage (e.g. to national infrastructure). Up to 14 years, or life.Aggravated forms of 264 carry longer sentences.
★Remember

Data law too: a breach of personal data must be reported (UK GDPR + Data Protection Act 2018 in the UK; EU GDPR + LOPDGDD in Spain). See Topic 19.

The password lock build uses a lock-out. Here's why that one rule matters so much:

  1. Without a lock-out, a computer can try about 1 billion guesses a second.

  2. Allow 3 tries, then lock for 10 seconds: that's 3 ÷ 10 = 0.3 guesses a second.

  3. A 6-letter lower-case password: 26⁶ ≈ 309 million possibilities.

  4. 309,000,000 ÷ 0.3 ≈ 1 billion seconds ≈ 33 years, instead of 0.3 seconds.

Common mix-ups

Read the left, then the right.

People think

A virus and a worm are the same thing.

Actually

A virus needs a person to spread it; a worm spreads by itself over the network.

People think

P@ssw0rd! is strong because it has symbols.

Actually

It's a dictionary word with common swaps. Attackers try those first. Length matters most.

People think

Looking around someone's account is fine if you don't change anything.

Actually

Unauthorised access alone is an offence (CMA section 1; art. 197 bis in Spain).

People think

A firewall stops viruses in email attachments.

Actually

A firewall filters network traffic. Infected files are anti-malware's job.

People think

Encryption stops data being stolen.

Actually

It can still be stolen; it just can't be read without the key.

People think

Hashing and encryption are the same.

Actually

Encryption can be reversed with the key. A hash is one-way.

People think

Only clever hackers cause breaches.

Actually

Most start with a person: a phishing click, a reused password, a lost laptop.

Check yourself

Quick questions, then endless practice with full working.

[ {"q":"A fake bank email asking you to log in is…","o":["Phishing","A worm","Brute force"],"a":0,"w":"It fishes for your details with a fake message."}, {"q":"Which spreads across a network without anyone opening a file?","o":["Virus","Worm","Trojan"],"a":1,"w":"A worm copies itself by itself. A virus needs a person to share the file."}, {"q":"Ransomware mainly breaks which part of the CIA triad?","o":["Confidentiality","Integrity","Availability"],"a":2,"w":"Your files are still there but you can't use them: availability."}, {"q":"Which makes a password hardest to crack?","o":["Adding length","Swapping o for 0","Adding ! at the end"],"a":0,"w":"Each extra character multiplies the possibilities; swaps are tried first by attackers."}, {"q":"Caesar shift 1: 'CAT' becomes…","o":["DBU","BZS","CAT1"],"a":0,"w":"C→D, A→B, T→U."}, {"q":"The best defence against SQL injection is…","o":["A firewall","Validation and parameterised queries","A longer password"],"a":1,"w":"Keep user input as data, never part of the command."}, {"q":"Logging into a friend's account 'just to look' is…","o":["Legal if you change nothing","An offence under the Computer Misuse Act","Only illegal in Spain"],"a":1,"w":"Unauthorised access alone is section 1 (and art. 197 bis in Spain)."}, {"q":"Websites should store your password as…","o":["Plain text","A hash","A Caesar cipher"],"a":1,"w":"A one-way fingerprint: a leak doesn't reveal the passwords."} ]