Integrity as a security evaluation criterion

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

Integrity as a security evaluation criterion

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. When evaluating a security strategy against integrity, which question should you ask?
A Does it stop unauthorised people changing or corrupting the data?
B Does it make sure the data is always online when needed?
2. A school stores a hash of each exam results file and recalculates it each night. Which integrity feature is this?
A Tamper detection, because a changed file gives a different hash
B Access limiting, because it stops students opening the file
3. Which control best supports integrity by limiting who can edit data?
A Giving every employee write permission so work is faster
B Giving only payroll staff write permission to the pay records
4. A file is downloaded and its checksum does not match the one published by the supplier. What does this suggest?
A The file has been successfully encrypted
B The file may have been corrupted or altered
5. A strategy encrypts all customer data but lets every staff member edit it. How does it rate on the integrity criterion?
A Weak, because unauthorised edits are still possible
B Strong, because encryption stops all changes

Match the Pairs

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

Left columnRight column
1SHA-256 hash of file = stored hash ALimiting who can change records so unauthorised users cannot alter or corrupt the data
2Edit permission: Payroll Officers only BGiving every staff member edit access lets unauthorised people change or corrupt data, so the integrity criterion is not met.
3A checksum lets a system detect that data was corrupted or changed during storage or transfer CChecking that a file has not been altered, because any change to the data would produce a different hash value
4An audit trail supports integrity by recording who changed a record and when, so unauthorised edits can be found DIF calculated_checksum != original_checksum THEN flag_file_as_changed
5Strategy: all staff can edit the customer database. Integrity criterion: met. EEncryption mainly protects confidentiality. It does not detect tampering or limit who can edit, so integrity is not shown to be met.
6Strategy: encrypt files so nobody can read them. Integrity criterion: fully met. FLOG: user=jsmith, action=EDIT, record=4521, time=14:02

Definitions

integrity criterion

Fill in the Blanks

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

1.
digest = hashlib.______(data).hexdigest()
2.
if newHash __ savedHash: print("Data is unchanged")
3.
GRANT ______ ON results TO viewer;
4.
REVOKE ______ ON results FROM intern;
5.
IF ________(file) != storedSum THEN ALERT("Possible tampering") END IF

Spot the Error

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

Question 1
A criterion = "availability"
B risk = "data is altered"
C control = "hash check"
Question 2
A stored = hash(file)
B later = hash(file)
C if stored == later:
D print("File tampered")
Question 3
A editors = ["admin", "hr"]
B if user not in editors:
C allow_edit()
D else: deny_edit()
Question 4
A old_hash = "a41f9c"
B new_hash = old_hash
C if new_hash != old_hash:
D alert("Tampering")
Question 5
A ok = ["admin", "hr"]
B for entry in edit_log:
C if entry.user in ok:
D flag(entry)

Answer Key

Integrity as a security evaluation criterion
Section A: Quick Questions
Q1
A — Does it stop unauthorised people changing or corrupting the data?
Q2
A — Tamper detection, because a changed file gives a different hash
Q3
B — Giving only payroll staff write permission to the pay records
Q4
B — The file may have been corrupted or altered
Q5
A — Weak, because unauthorised edits are still possible
Section B: Match the Pairs
Q1
SHA-256 hash of file = stored hash → Checking that a file has not been altered, because any change to the data would produce a different hash value
Q2
Edit permission: Payroll Officers only → Limiting who can change records so unauthorised users cannot alter or corrupt the data
Q3
A checksum lets a system detect that data was corrupted or changed during storage or transfer → IF calculated_checksum != original_checksum THEN flag_file_as_changed
Q4
An audit trail supports integrity by recording who changed a record and when, so unauthorised edits can be found → LOG: user=jsmith, action=EDIT, record=4521, time=14:02
Q5
Strategy: all staff can edit the customer database. Integrity criterion: met. → Giving every staff member edit access lets unauthorised people change or corrupt data, so the integrity criterion is not met.
Q6
Strategy: encrypt files so nobody can read them. Integrity criterion: fully met. → Encryption mainly protects confidentiality. It does not detect tampering or limit who can edit, so integrity is not shown to be met.
Section C: Definitions
Q1
integrity criterion — Judging a security strategy by whether it stops unauthorised people changing or corrupting data, using tamper detection, hashes and checksums, and limits on who can edit.
Section D: Fill in the Blanks
Q1
digest = hashlib.sha256(data).hexdigest()
Q2
if newHash == savedHash: print("Data is unchanged")
Q3
GRANT SELECT ON results TO viewer;
Q4
REVOKE UPDATE ON results FROM intern;
Q5
IF checksum(file) != storedSum THEN ALERT("Possible tampering") END IF
Section E: Spot the Error
Q1
A — The risk and control describe data being altered and caught by a hash check, so the criterion is integrity. Availability is about whether data can be accessed, so the first line should be criterion = "integrity".
Q2
D — The message runs when the two hashes match, which means the file is unchanged. Saying 'tampered' is the wrong conclusion. It should print "File unchanged".
Q3
B — Using 'not in' lets only people who are NOT authorised edit the data, which defeats the integrity control. The check should be if user in editors:.
Q4
B — The new hash must be recalculated from the current file. Copying old_hash means the two values always match and tampering is never detected. It should be new_hash = hash(file).
Q5
C — The audit check should flag edits made by people who are NOT authorised. Flagging authorised users gives false alarms and misses real tampering. It should be if entry.user not in ok:.