TryCatchLearn / DatingApp30

Repo for dotnet core 3.0
113 stars 74 forks source link

Computed Hash and Password Hash Not Equal #6

Open kumarangp opened 4 years ago

kumarangp commented 4 years ago

In AuthRepository.cs VerifyPasswordHash() method computed hash and password hash not same when giving correct password. how to solve this problem ?

using (var hmac = new System.Security.Cryptography.HMACSHA512(passwordSalt)) { var computedHash = hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(password)); for(int i = 0; i < computedHash.Length; i++) { if(computedHash[i] != passwordHash[i]) return false; } return true; }