Data Security, Integrity and Ethics: Question 8
Syllabus 6.2
BrightBooks is building a new account registration system for its online store.
- The Membership Code box must contain exactly 2 uppercase letters followed by 4 digits (for example, AB1234).
- The Password box must contain at least 8 characters.
- Completed order files are sent from the website's server to the warehouse computer over a network link. Before sending a file, the website server adds up the numeric value of every byte in the file to produce a single total, and sends this total along with the file. After receiving the file, the warehouse computer recalculates the same total from the data it has actually received and compares it to the total that was sent.
(a) Name a suitable validation check for the Membership Code box, and use it to explain whether the entry "AB123" would be accepted. [2]
(b) Name a suitable validation check for the Password box, and use it to explain whether the entry "Cats22" would be accepted. [2]
(c) Name the check being used to check the order file after it has been transferred, and explain how it detects that the file has been corrupted during transfer. [2]
Show worked solution Hide worked solution
Worked solution
Part (a): Validating the Membership Code box
A format check is appropriate here, since a Membership Code must match a specific pattern: 2 uppercase letters followed by 4 digits.
Checking “AB123” against this pattern: the first two characters, “AB”, are uppercase letters, as required. However, what follows is “123”. Only 3 digits, not the 4 digits the pattern requires. Because the entry does not match the required 2-letters-then-4-digits pattern, the format check rejects it.
[2 marks]: [1] for naming a format check, [1] for correctly explaining that “AB123” is rejected because it has only 3 digits instead of the required 4.
Part (b): Validating the Password box
A length check is appropriate here, since a password must contain at least 8 characters.
Counting the characters in “Cats22”: C-a-t-s-2-2, which is 6 characters in total. Since 6 is fewer than the required minimum of 8, the length check rejects this entry.
[2 marks]: [1] for naming a length check, [1] for correctly explaining that “Cats22” is rejected because it has only 6 characters, fewer than the minimum of 8.
Part (c): Checking the transferred order file
This is an example of a checksum. Before sending the file, the website server calculates a single total value from the data in the file (here, by adding up the numeric value of every byte) and transmits this total alongside the file itself.
After receiving the file, the warehouse computer independently recalculates the same total from the bytes it has actually received, and compares this recalculated value to the checksum that was sent:
- If the two values match, the file is very likely to have arrived without corruption.
- If the two values differ, at least one byte must have changed during transfer, so the file is flagged as corrupted and can be requested again.
[2 marks]: [1] for naming a checksum, [1] for correctly explaining that a mismatch between the recalculated and transmitted totals reveals that the file was corrupted during transfer.
Final answers
- (a) Format check; “AB123” is rejected as it has only 3 digits instead of the required 4.
- (b) Length check; “Cats22” is rejected as it has only 6 characters, fewer than the minimum of 8.
- (c) Checksum; a mismatch between the recalculated total and the transmitted total shows the file was corrupted during transfer.