← WA Computer Science ATAR Unit 2

Integrity

Data stays accurate, complete and unaltered unless an authorised person changes it. Tampering breaks integrity by altering data without permission.

Understanding Integrity in WA Computer Science ATAR Unit 2

What it does: The UPDATE statement alters stored data without authorisation, which is tampering and means the mark is no longer accurate. The check allows only an authorised role to change the data, so unauthorised changes are blocked and the data stays unaltered. Integrity is about keeping data accurate, complete and unaltered. Keeping data secret is confidentiality. This is the core definition of integrity in the CIA triad: data can be trusted because it has not been changed without permission.

Common mistakes: To detect tampering, store the hash of the original message. The length is not a reliable fingerprint because altered data can keep the same length. It should be saved = hash(msg). The condition is reversed. Matching hashes mean the data is unaltered, so a tampering warning must run when the hashes are different: if hash(file) != saved:.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 28–122) and word search (Modules 28–266).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which statement best describes integrity in cyber security?
Data is hidden so that only authorised people can read itData stays accurate and unaltered unless an authorised person changes it
Matches
A hacker edits a bank balance from $500 to $5000. The data is still available, so integrity is intact.
↓
Altering the balance without permission is tampering, which breaks integrity even though the data is still available and readable.
Applying
Meanings
Term
integrity
Meaning
Data stays accurate, complete and unaltered unless an authorised person changes it. Tampering breaks integrity by altering data without permission.
Practice
UPDATE results SET mark = 100 WHERE studentId = 1 AND subjectId = 1;
Testing
Gaps
if original received:
Check Answer
Spots
1msg = 'Pay Sam $50'
2saved = len(msg)

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Giant Isopod' badge — Patient Builder, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which statement best describes integrity in cyber security?
A. Data is hidden so that only authorised people can read it
B. Data stays accurate and unaltered unless an authorised person changes it ✓
Integrity is about keeping data accurate, complete and unaltered. Keeping data secret is confidentiality.
2. A student breaks into the school system and changes their own mark from 52 to 92. What has been broken?
A. Integrity, because the data was altered without permission ✓
B. Availability, because the marks can no longer be opened
Altering data without permission is tampering, and it breaks integrity. The marks can still be opened, so availability is not the issue.
3. Which of these is an example of tampering?
A. An attacker edits the amount in a bank transfer before it is processed ✓
B. A teacher updates a student's address after the student asks
Tampering is changing data without permission. A teacher making a requested update is an authorised change, so integrity is kept.
4. True or false: If an authorised person updates a record, integrity has been broken.
A. False: authorised changes do not break integrity ✓
B. True: any change to data breaks integrity
Integrity allows data to change when an authorised person makes the change. It is unauthorised changes that break integrity.
5. Which result would show that integrity has been lost?
A. A stock count of 40 can be seen only by managers
B. A stock count of 40 has been secretly changed to 400 ✓
A secretly altered value means the data is no longer accurate. Limiting who can view it relates to confidentiality.

Match the Pairs

integrity → Data stays accurate, complete and unaltered unless an authorised person changes it
tampering → Altering data without permission, which breaks integrity
A student secretly changes their own mark in the school database, breaking integrity → UPDATE results SET mark = 100 WHERE studentId = 1;
Integrity is kept when only an authorised person can change data → if user.role == "teacher": update_mark()
A hacker edits a bank balance from $500 to $5000. The data is still available, so integrity is intact. → Altering the balance without permission is tampering, which breaks integrity even though the data is still available and readable.
An admin corrects a typo in a customer's address. This breaks integrity because the data was changed. → Integrity allows changes made by an authorised person, so a correction by an admin does not break it.

Key Term

integrity
Data stays accurate, complete and unaltered unless an authorised person changes it. Tampering breaks integrity by altering data without permission.

Fill in the Blanks

1. if original != received: print("Tampering detected")
Hint: Type the comparison operator that is true when the two values are different.
2. if saved != current: print("Integrity lost")
Hint: Type the keyword that starts a condition check.
3. allowed = False if allowed: mark = 90
Hint: Type the variable that decides whether the change is permitted.
4. staff = ["teacher", "admin"] if user in staff: mark = 95
Hint: Type the keyword that checks whether a value is in a list of authorised people.
5. def changed(old, new): return old != new print(changed("A", "B"))
Hint: Type the keyword that defines a function.

Spot the Error

Question 1
A msg = 'Pay Sam $50'
B saved = len(msg)
C got = 'Pay Sam $500'
D print(hash(got) == saved)
Line B — To detect tampering, store the hash of the original message. The length is not a reliable fingerprint because altered data can keep the same length. It should be saved = hash(msg).
Question 2
A saved = hash(file)
B if hash(file) == saved:
C print('Data was changed')
D else:
E print('File is intact')
Line B — The condition is reversed. Matching hashes mean the data is unaltered, so a tampering warning must run when the hashes are different: if hash(file) != saved:.
Question 3
A role = 'student'
B if role != 'teacher':
C grades[0] = 95
D else:
E print('Edit denied')
Line B — Integrity means only authorised people may change data. With != every role except the teacher can edit the grades. It should be if role == 'teacher':.
Question 4
A nums = [4, 8, 15]
B total = sum(nums)
C nums[1] = 80
D if len(nums) != total:
E print('Data changed')
Line D — The check must compare the new sum with the saved sum. The list length stays at 3 even after tampering, so the change would be missed. It should be if sum(nums) != total:.
Question 5
A report = download()
B published = '9f2c1a'
C current = hash(report)
D ok = current = published
E print('Intact:', ok)
Line D — A single = assigns a value instead of comparing, so no integrity check happens. It should use the comparison operator: ok = current == published.

Student with a class code? Join your class →