Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1sha256(before) == sha256(after) | ADifferent hashes mean the file has changed. It may have been tampered with or corrupted, so it should not be trusted. | |
| 2sha256(before) != sha256(after) | Bchecksum = sha256(file) | |
| 3A file checksum is the hash of a file, published by the sender so the receiver can check the download | CWith no hash from before the transfer there is nothing to compare against, so tampering cannot be detected. The file must be hashed before and after. | |
| 4After a transfer, the receiver hashes the received file and compares it with the sender's hash to detect tampering | Dif sha256(received) == sentHash | |
| 5Only hash the file after transfer, then assume it is unchanged | EThe two hashes match, so the file has not changed during transfer and its integrity is intact | |
| 6Hashes differ, so the file is unchanged and safe to use | FThe hashes differ, so the file was altered, corrupted or tampered with and its integrity is lost |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
hash comparison — Hash the file before and after transfer. If both hashes (checksums) match, the data is unchanged. A different hash shows the file was altered or tampered with, so its integrity is lost.hashBefore ← hash(file)IF hashBefore = hashAfter THEN
OUTPUT "Data unchanged"
ENDIFIF hashBefore ≠ hashAfter THEN
OUTPUT "File was tampered with"
ENDIFreceived ← download(url)
hashAfter ← hash(received)IF checksum = published THEN OUTPUT "Safe"
ELSE OUTPUT "Altered"
ENDIF