Study Guide

Data integrity

Computer ScienceΒ· Unit 6: Security, privacy and data integrityΒ· 6 min read

1. Core Concepts: What is Data Integrity?β˜…β˜…β˜†β˜†β˜†β± 10 min

πŸ“˜ Definition

Data Integrity

The property of data that ensures it remains accurate, complete and consistent over time, and is not altered in an unauthorised or accidental way.

Example:

A bank transaction that retains its correct value after storage and transfer has intact data integrity.

Data integrity is often confused with two related concepts, which CIE regularly asks you to distinguish:

  • Data accuracy: Refers to whether data correctly represents the real-world concept it describes. Data can be consistent (high integrity) but inaccurate (e.g. a wrong customer date of birth stored correctly).

  • Data security: Refers to protecting data from unauthorised access. Data can be secure but corrupted (e.g. encrypted data damaged on disk loses integrity while still being inaccessible to unauthorised users).

πŸ“ Worked Example

A student enters their date of birth as 12/13/2005 (month 13) in an online form. Does this affect accuracy, integrity, or both?

  1. 1

    The value 13 for a month is invalid and does not match the student's real date of birth, so this is an accuracy error.

  2. 2

    If the system stores the value 13 consistently without corruption, the data remains unmodified as entered: it still has integrity.

  3. 3

    Conclusion: This is an accuracy error, not an integrity error. A validation rule would maintain integrity by rejecting the invalid entry before storage.

Exam tip:

When asked to distinguish between these terms, always define each one separately to earn full marks.

2. Common Threats to Data Integrityβ˜…β˜…β˜†β˜†β˜†β± 15 min

Data integrity can be compromised by both accidental and intentional events:

  • Accidental corruption: Hardware failure (e.g. bad disk sectors), network transmission errors, power loss during write operations, or human error during data entry/editing.

  • Intentional corruption: Unauthorized modification by attackers, malicious software that alters data, or insider tampering with records.

  • Physical/environmental damage: Damage to storage media from heat, water or impact that flips stored bits.

πŸ“ Worked Example

A power cut occurs while a bank is saving a new customer transaction record. Explain the impact on data integrity.

  1. 1

    Only part of the new transaction record may be written to disk before power is lost.

  2. 2

    This leaves the record incomplete, and can corrupt the file system index that locates records on storage.

  3. 3

    The data is now inconsistent and incomplete: this is a direct loss of data integrity.

Exam tip:

Always link the threat to a specific impact on integrity, do not just describe the threat itself.

3. Error Detection: Parity and Checksumsβ˜…β˜…β˜…β˜†β˜†β± 25 min

πŸ“˜ Definition

Checksum

A small numerical value calculated from a block of data, used to verify that data has not been corrupted during transmission or storage.

Example:

An 8-bit checksum calculated by summing all bytes in a data packet.

Parity checking is the simplest error detection method. One extra parity bit is added to each data block, making the total number of 1 bits either even (even parity) or odd (odd parity).

πŸ“ Worked Example

What is the parity bit for the 7-bit data 1011010 using even parity?

  1. 1

    Count the number of 1 bits in the input data:

  2. 2
    1+0+1+1+0+1+0=41 + 0 + 1 + 1 + 0 + 1 + 0 = 4
  3. 3

    Even parity requires the total number of 1 bits (including parity) to be even. 4 is already even, so the parity bit is 0.

  4. 4

    Final 8-bit transmitted value: 01011010

πŸ“ Worked Example

Calculate the 8-bit checksum for 3 bytes: 01001011, 00101001, 01011100

  1. 1

    Convert each binary byte to decimal: , ,

  2. 2

    Calculate the sum of the values:

  3. 3
    75+41+92=20875 + 41 + 92 = 208
  4. 4

    For 8-bit checksum, we keep only the 8-bit result (discard overflow). 208 in 8-bit binary is 11010000, so this is the checksum.

Exam tip:

Always explicitly state whether you are using even or odd parity in your answer to earn full marks.

4. Other Integrity Maintenance Mechanismsβ˜…β˜…β˜…β˜†β˜†β± 15 min

Beyond basic error detection, there are many mechanisms used to maintain long-term data integrity:

  • Cryptographic hashing: Generates a fixed-size hash from input data; any change to data changes the hash. Used to verify integrity against intentional tampering.

  • Redundancy and backups: Multiple copies of data across different locations allow recovery of intact data if one copy is corrupted. RAID storage uses this for hardware failure tolerance.

  • Database validation rules: Constraints (data type checks, range checks, foreign key rules) ensure only valid, consistent data is stored.

  • Cyclic Redundancy Check (CRC): A polynomial-based error detection method used in networks and storage, more effective than simple checksums.

βœ“ Quick check

Test your understanding:

  1. Which of the following can simple parity detect?

    • A: Any 1-bit error

    • B: Any 2-bit error

    • C: All errors regardless of size

    • D: No errors

    Reveal answer
    A β€”

    A 1-bit flip changes the number of 1 bits by 1, which changes the parity, so it is detected. 2 bit flips leave parity unchanged, so they go undetected.

5. Common Pitfalls

Wrong move:

Confusing data integrity with data accuracy or data security

Why:

CIE regularly asks to distinguish these terms; mixing them up loses all marks

Correct move:

Remember: integrity = consistent and unmodified, accuracy = correct vs real world, security = protected from unauthorised access

Wrong move:

Claiming simple parity can correct errors

Why:

Candidates often overstate what parity can do, leading to lost marks

Correct move:

Always state that parity can only detect an odd number of bit errors, it cannot correct errors

Wrong move:

Miscounting 1 bits when calculating parity

Why:

This is the most common avoidable error in parity calculation questions

Correct move:

Count 1 bits in the original data first, then add the parity bit to get the required total parity

Wrong move:

Claiming checksums prevent data corruption

Why:

Checksums only detect corruption, they do not stop it from occurring

Correct move:

Checksums are error detection tools: they identify corruption so you can restore or retransmit data

6. Quick Reference Cheatsheet

Concept

Purpose

Key Capability

Data Integrity

Guarantee data is consistent/unmodified

Core requirement for reliable systems

Even Parity

Simple error detection

Detects odd number of bit errors

Odd Parity

Simple error detection

Detects odd number of bit errors

Checksum

Error detection

Detects most accidental corruption

Cryptographic Hash

Integrity verification

Detects accidental and intentional modification

Simple Parity

Error detection

Cannot correct errors or detect even errors

7. Frequently Asked

What is the difference between data integrity and data security?

Data integrity refers to the accuracy and consistency of data over its lifecycle, while data security refers to protecting data from unauthorized access, modification or breach. You can have secure data that has lost integrity (e.g. corrupted encrypted storage) and intact data that is not secure.

Can simple parity check correct errors?

No. Simple parity checking can only detect an odd number of bit errors. It cannot correct errors or detect an even number of flipped bits. More complex codes like Hamming code are required for error correction.

When this came up on past exams

AI-estimated based on syllabus patterns β€” cross-check with official past papers for accuracy. Use only as revision-focus signals.

  • 2022 Β· 1

    Checksum error detection calculation

  • 2023 Β· 2

    Threats to data integrity question

Going deeper

What's Next

Understanding data integrity is a foundational concept for further study of database systems, network security and cryptography. The error detection methods you learned here are used daily in data storage, network communications and cloud computing, and form the basis for more advanced error correction techniques used in everything from USB drives to satellite communications. Data integrity works alongside data security mechanisms to protect digital information, and underpins the reliability of all modern computer systems.