.net Core 登录密码使用MD5算法加密

 public string Login(LoginModel model)
        {
            string Salt = "!@#trtailw!#@";
            model.Password = BitConverter.ToString(
                MD5.Create().ComputeHash(Encoding.ASCII.GetBytes(model.Password + Salt))
                ).Replace("-","");
            return _loginRepository.Login(model);
        }       

记得要引入“System.Security.Cryptography.Algorithms” NuGet包。

猜你喜欢

转载自blog.csdn.net/weixin_42775017/article/details/84557195