Multiple choice technology security

How can we prevent dictionary attacks on password hashes ?

  1. Hashing the password twice

  2. Encrypting the password using the private key

  3. Use an encryption algorithm you wrote your self so no one knows how it works

  4. Salting the hash

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Salting (adding random data before hashing) prevents dictionary and rainbow table attacks by ensuring identical passwords produce different hashes. Hashing twice (A) adds negligible security. Private key encryption (B) isn't applicable to password storage. Custom encryption (C) violates Kerckhoffs's principle and is rarely secure.