Password hashing with Crypto.HashPassword

redgreenwhite 0 Reputation points
2023-01-15T10:26:26.07+00:00

Hi.

For a school project, a new user's password was saved as Crypto.HashPassword. Now I'm trying to add option to change password, for that the user provides his current password and it compares to the saved, hashed one. The problem is, it keeps returning different hash for the same passwords. Does it use different salt every time? And if so how can I compare them?

Crypto.VerifyHashedPassword doesn't work.

Developer technologies | ASP.NET Core | Other
0 comments No comments

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. redgreenwhite 0 Reputation points
    2023-01-15T10:40:29.9133333+00:00

    I appreciate your advice, but I was being an idiot and sending the wrong value to VerifyHashedPassword. After fixing it, I can confirm that VerifyHashedPassword does allow to compare saved and new password.

    Thanks.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.