public bool CheckPassword(string password) { var bytePassword = Encoding.UTF8.GetBytes(password); var newHashedPassword = HashAndSalt.GenerateSaltedHash(bytePassword, Salt); return(newHashedPassword.CompareByteArrays(HashedPassword)); }
public void SetPassword(string password) { var bytePassword = Encoding.UTF8.GetBytes(password); Salt = HashAndSalt.GetSalt(SaltLength); HashedPassword = HashAndSalt.GenerateSaltedHash(bytePassword, Salt); }