Integrity

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Integrity

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which statement best describes integrity in cyber security?
A Data can be reached by anyone who wants to see it
B Data stays accurate and unaltered unless an authorised person changes it
2. A hacker secretly changes your bank balance from $500 to $5000. Which part of security has been broken?
A Integrity
B Availability
3. Which one is an accidental change that breaks integrity?
A A staff member types $1000 instead of $100 into a record
B A criminal edits a record to steal money on purpose
4. True or false: Only deliberate attacks can break integrity.
A False
B True
5. Who is allowed to change data without breaking integrity?
A Any user on the network
B An authorised person

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Integrity Adeposit +100 by teller (logged)
2balance = 5000 -> 50000 (hacker) BData stays accurate and unaltered unless an authorised person changes it
3An accidental change can break integrity, such as a typing slip that makes a balance wrong CA deliberate change that breaks integrity, like a tampered bank balance
4An authorised change keeps integrity, because the update is approved and recorded DThis describes confidentiality, not integrity. Integrity is about data staying accurate and unaltered unless an authorised person changes it.
5Integrity means keeping data secret from others EIntegrity can also be broken by accidental changes, such as typing errors or software faults, not only deliberate attacks.
6Only hackers can break integrity Fbalance = 1500 -> 150 (typo)

Definitions

Integrity

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
__ user_is_authorised THEN balance ← new_balance END IF
2.
withdraw ← 50 balance ← balance _ withdraw
3.
IF hash(file) _ stored_hash THEN alert("File changed") END IF
4.
IF ___ is_authorised THEN DISPLAY "Change blocked" END IF
5.
backup ← balance balance ← 9999 balance ← ______

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A IF NOT authorised THEN
B balance ← newBalance
C ELSE
D display "Change denied"
Question 2
A balance ← 500
B withdraw ← 120
C IF withdraw ≤ balance THEN
D balance ← balance + withdraw
Question 3
A storedHash ← hash(file)
B newHash ← hash(file)
C IF storedHash = newHash THEN
D display "File unchanged"
Question 4
A old ← 800
B new ← 200
C IF new = old THEN
D display "Balance changed"
Question 5
A amount ← input()
B IF amount < 0 THEN
C balance ← balance + amount
D ENDIF

Answer Key

Integrity
Section A: Quick Questions
Q1
B — Data stays accurate and unaltered unless an authorised person changes it
Q2
A — Integrity
Q3
A — A staff member types $1000 instead of $100 into a record
Q4
A — False
Q5
B — An authorised person
Section B: Match the Pairs
Q1
Integrity → Data stays accurate and unaltered unless an authorised person changes it
Q2
balance = 5000 -> 50000 (hacker) → A deliberate change that breaks integrity, like a tampered bank balance
Q3
An accidental change can break integrity, such as a typing slip that makes a balance wrong → balance = 1500 -> 150 (typo)
Q4
An authorised change keeps integrity, because the update is approved and recorded → deposit +100 by teller (logged)
Q5
Integrity means keeping data secret from others → This describes confidentiality, not integrity. Integrity is about data staying accurate and unaltered unless an authorised person changes it.
Q6
Only hackers can break integrity → Integrity can also be broken by accidental changes, such as typing errors or software faults, not only deliberate attacks.
Section C: Definitions
Q1
Integrity — Data stays accurate and unaltered unless an authorised person changes it. Accidental or deliberate changes break it, such as a tampered bank balance.
Section D: Fill in the Blanks
Q1
IF user_is_authorised THEN balance ← new_balance END IF
Q2
withdraw ← 50 balance ← balance - withdraw
Q3
IF hash(file) ≠ stored_hash THEN alert("File changed") END IF
Q4
IF NOT is_authorised THEN DISPLAY "Change blocked" END IF
Q5
backup ← balance balance ← 9999 balance ← backup
Section E: Spot the Error
Q1
A — The check is reversed, so only unauthorised users could change the balance. Integrity needs only authorised people to make changes: IF authorised THEN.
Q2
D — A withdrawal must subtract from the balance. Adding it is an accidental error that makes the data inaccurate. It should be balance ← balance - withdraw.
Q3
B — This hashes the original file again, so the hashes always match and tampering would never be found. It should hash the downloaded copy: hash(download).
Q4
C — The test is wrong. It reports a change only when the values are equal. To detect a tampered balance it must check that they differ: IF new ≠ old THEN.
Q5
B — This accepts only negative amounts, so a typing slip could corrupt the balance and valid deposits are rejected. Validation should check that amount > 0.