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 | |
|---|---|---|
| 1SHA-256("password") | AThe hash length depends on the input, but it should be fixed whatever the input size. | |
| 2hash("data") == hash("data") | Bhash("Cat") != hash("Cap") | |
| 3A small change to the input gives a completely different hash | CThe same input always gives the same hash, so the comparison is true | |
| 4The output is a fixed length, however long the input is | DA hash function is one-way, so a hash cannot be reversed or decrypted to get the original input back. | |
| 5original = decrypt(hashValue) | Elen(hash("a")) == len(hash(bigFile)) | |
| 6hash("Hi") = 2 characters long | FRuns the input through a hash function to produce a fixed-length 64-character hash value |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
hash function — A one-way function that turns any input into a fixed-length value. The same input always gives the same hash, a tiny change gives a very different one, and it cannot be reversed.import hashlib
h = hashlib.sha256(b"hi").hexdigest()
print(h)h1 = hashlib.sha256(b"cat").hexdigest()
h2 = hashlib.sha256(b"cat").hexdigest()
print(h1 == h2)h = hashlib.sha256(b"a").hexdigest()
print(len(h))h1 = hashlib.sha256(b"pass1").hexdigest()
h2 = hashlib.sha256(b"pass2").hexdigest()
print(h1 != h2)stored = hashIt("Secret1")
entered = "Secret1"
print(hashIt(entered) == stored)