Multiple choice technology security

What is the method signature for hashing password?

  1. String hashPassword(String password)

  2. String hashPassword(String password, String accountName)

  3. String hashpassword(String password)

  4. None of the above

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

The hashPassword method requires both the password and accountName parameters. The accountName is typically used as a salt or to ensure uniqueness of hashes across accounts. Option A only takes the password, which would result in identical passwords producing identical hashes - a security vulnerability. Option C has incorrect capitalization.