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 | |
|---|---|---|
| 1send = encrypt(compress(data)) | AEncrypting before compressing. Encrypted data looks random, so it has no patterns for compression to remove and the file barely shrinks. | |
| 2data = decompress(decrypt(received)) | BThe receiving steps are in the wrong order. The data arrives encrypted, so it must be decrypted before it can be decompressed. | |
| 3Encrypted data looks random, so compressing it afterwards saves almost no space. Compress before encrypting. | CCompress the data first, then encrypt the compressed result before sending | |
| 4A hash of the original data lets the receiver check integrity once the data has been decrypted and decompressed. | DOn receiving, reverse the order: decrypt first, then decompress | |
| 5send = compress(encrypt(data)) | Edigest = hash(data) same = hash(restored) == digest | |
| 6data = decrypt(decompress(received)) | Fpacked = compress(data) secret = encrypt(packed) |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
compress then encrypt — Compress first, then encrypt, and hash to check integrity. Encrypted data looks random so it cannot be compressed. On receiving, reverse the order: decrypt, then decompress.packed = compress(message)
secret = encrypt(packed, key)
send(secret)packed = compress(message)
secret = encrypt(packed, key)
send(secret)packed = compress(message)
check = hash(packed)
secret = encrypt(packed, key)packed = decrypt(secret, key)
message = decompress(packed)
print(message)packed = decrypt(secret, key)
message = decompress(packed)
print(message)