Q26: Why is password stored as hash?

Question #26: Usually passwords in our systems are not stored as it is, but only their hash is stored. If PW is the password, then f(PW) is stored which is not invertible. What do you think is the intention behind this?

Options:

A)     So that some malicious user doesn’t change the password file.

B)      So that some malicious can’t see password in some text file as PW can’t be obtained from f(PW).

C)      So that some malicious user can’t guess the password.

D)     None of the above

 

Solution:

By storing hash instead of password, malicious user can still change the hash file, thereby indirectly changing password if it has root access. But it won’t be able to see the password and hash is not invertible back to password. Hence, the correct answer is option B.