Data integrity

Computer Science AS · Security, privacy and data integrity. The idea in plain words, the rules to remember, the mistake to avoid and a worked example, written and checked by Mega Lecture.

Test this topic freeAll Computer Science AS topics

The idea

Data has integrity when it is accurate and has not been changed by mistake. Two processes protect it. Validation is an automatic check by the software that data is reasonable and follows the rules. Verification checks that data has been copied correctly from its source, at entry or during transfer.

Neither one proves the data is true. A wrong date of birth can still be a sensible date and pass every validation check.

During transfer, bits can flip. A parity bit is added to each byte so the number of 1s is even (even parity) or odd (odd parity). The receiver counts the 1s again. A checksum is a value calculated from the whole block and sent with it.

In simpler words

Data has integrity when it is correct and has not been changed by mistake. Validation is the computer checking data is sensible, like a mark between 0 and 100. Verification checks data was copied right, like typing it twice. Neither proves it is true. When data is sent, bits can flip. A parity bit helps spot this by making the count of 1s even or odd.

An everyday comparison

Validation is like a form that rejects an age of 250: the answer is impossible. Verification is like reading your phone number back to the caller to check they copied it right. Neither catches a sensible but wrong answer, such as a mistyped birthday that is still a real date. The comparison stops working for parity: it counts 1s, and two flipped bits in one byte go unnoticed, which no human check quite matches.

Rules to remember

Common mistake

Do not mix up validation and verification. Validation asks whether the data is sensible; verification asks whether it matches the source. Neither one checks that the data is correct.

In the exam

Define both terms first: validation checks that data is reasonable and follows rules; verification checks it matches the source. For a named field, name the check and give a suitable rule, e.g. range check 0 to 100. For parity, show the counting of 1s, state even or odd, and say a single-byte check cannot locate the error. For a parity block, explain that row and column parity together locate and correct one wrong bit.

Worked example

A check digit for a 4-digit code uses weights 5, 4, 3, 2. The total is taken MOD 11 and the result is subtracted from 11. Find the check digit for 2351.

  1. Multiply each digit by its weight: 2 × 5 = 10, 3 × 4 = 12, 5 × 3 = 15, 1 × 2 = 2.
  2. Add the results: 10 + 12 + 15 + 2 = 39.
  3. 39 MOD 11 = 6, because 3 × 11 = 33 and 39 − 33 = 6.
  4. Check digit = 11 − 6 = 5.

Answer: The check digit is 5, so the full code is 23515.

Ask about this

Type what you are stuck on. The helper finds the explanation, worked examples and the notes to read, free and instant.

Keep going

← Data securityEthics and ownership →Take a Computer Science AS test