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 | |
|---|---|---|
| 1hash(password + salt) | ACreates a new random salt for a user | |
| 2salt = random_string(16) | BAdds a random salt to the password before hashing it | |
| 3Each user gets their own salt, so two users with the same password end up with different hashes | CThe plain password is stored instead of the salted hash, so anyone who steals the database can read it. | |
| 4A salt defeats precomputed hash tables because the attacker cannot prepare hashes for every possible salt | Duser1.salt != user2.salt | |
| 5salt = "abc" hash(password + salt) | EThe salt is a fixed value, not random, so every user shares the same salt and identical passwords still give identical hashes. | |
| 6store(username, password, salt) | Fhash("cat123" + "x9Qp") != hash("cat123") |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
salt — A random value added to a password before hashing, so identical passwords give different hashes. Each user gets their own salt, which defeats precomputed hash tables.storedHash ← hash(salt + password)salt ← random(16)
storedSalt ← salthash1 ← hash("cat123" + salt1)
hash2 ← hash("cat123" + salt2)IF hash(attempt + salt) == storedHash
PRINT "Login OK"FOR EACH user IN users
user.salt ← random(16)
user.hash ← hash(user.pw + user.salt)