Cryptography

An auditor finds that several users in a password table have identical stored hash values. What is the best fix?

Show the answer

Correct answerC. Add a unique random salt to each password before hashing

AWhy not this: length helps against guessing but two users with the same password still get the same hash.

BWhy not this: a longer digest is still deterministic for the same input, so duplicates would remain.

CWhy this is right: a per-password random salt makes the hash input unique, so equal passwords no longer share a hash.

DWhy not this: hashing again is deterministic, so identical passwords still yield identical stored values.

A unique random salt per password makes identical passwords hash to different values and defeats precomputed rainbow tables. Rehashing or a longer digest still gives identical output for identical input.