← Quiz: Password Storage Lab: all 10 questions
Quiz: Password Storage Lab · Question 5 of 10
What does this print? (code)
What does this print?
import hashlib
a = hashlib.pbkdf2_hmac("sha256", b"pw", b"salt-one", 1000).hex()
b = hashlib.pbkdf2_hmac("sha256", b"pw", b"salt-two", 1000).hex()
c = hashlib.pbkdf2_hmac("sha256", b"pw", b"salt-one", 1000).hex()
print(a == b, a == c)
- A.True True
- B.False False
- C.False True
- D.True False
Answer & explanation
Correct answer: False True
A different salt gives a different hash; the same inputs always give the same hash.
Can you get the rest right without peeking?
Take the timed Quiz: Password Storage Lab quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →