(C#) CryptoService 验证密码(检查密码是否正确)

时间:2020-12-22 06:06:38

标签: encryption cryptography

我正在使用加密服务来验证用户加密的密码 这是我的代码:

            if (!string.IsNullOrEmpty(lastPassword))
            {
              if (!lastPassword.Equals(Utilities.Encryt(oldPassword)))
              {                       
                    idx = -1;
               }  
  //// in utilities Encryt method
  public static string Encryt(string source)
    {
        CryptoServices hashService = new CryptoServices();
        return hashService.Encrypt(source);
    }                  
 }

此加密服务第一次运行不正常,第二次给出实际结果,帮助验证加密密码,谢谢

0 个答案:

没有答案
相关问题