/// <summary> /// updates the database with new password hash /// </summary> /// <param name="password">The new password</param> public async Task ChangeUserHash(string password, string username) { try { var result = await App.Repository.UsernameAndHash.GetUsernameAndHash(username); result.PasswordHash = SwatIncCrypto.SwatIncSecurityCreateHashSHA512(password); var save = await App.Repository.UsernameAndHash.UpsertAsync(result); } catch (Exception) { throw; } }
private bool VerifyPassword(string password, string goodHash) { return(SwatIncCrypto.VerifyPassword(password, goodHash)); }
private string HashPassword(string password) { return(SwatIncCrypto.SwatIncSecurityCreateHashSHA512(password)); }