public bool Login(Account account, string password) { try { var salt = Convert.FromBase64String(account.Salt); var hash = HashAlgorithm.GenerateExistingHash(password, salt); return(hash == account.Hash); } catch (Exception) { return(false); } }
public bool Login(Account account, string password) { try { var salt = Convert.FromBase64String(account.Salt); var hash = HashAlgorithm.GenerateExistingHash(password, salt); return(hash == account.Hash); } catch (Exception) { return(false); } }