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.

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.

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