Skip to content
Sharp

Authentication · interview question

Why is it useful to adding a salt to a password before hashing it?

Multiple choiceMediumchapter-17-curatedpremiumauthenticationsalting-and-bcrypt
Choose one answer
Answer and explanation

Correct answer

D. To ensure that duplicate passwords do not produce the same hash.

Why

Salting a password involves appending a unique random value to it before hashing. This ensures that even if two users have the same password, their hashes will be different, making attacks like rainbow tables ineffective.

Test yourself on Authentication

A free test with instant, explained results. No account needed.

Start free test
All Authentication questions →