예제 #1
0
        /// <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;
            }
        }
예제 #2
0
 private bool VerifyPassword(string password, string goodHash)
 {
     return(SwatIncCrypto.VerifyPassword(password, goodHash));
 }
예제 #3
0
 private string HashPassword(string password)
 {
     return(SwatIncCrypto.SwatIncSecurityCreateHashSHA512(password));
 }