数据加密

说明

      对于敏感数据我们将采用数据加密措施进行数据保护。目前主要是针对连接字符串和登录密码进行加密。加密和解密主要是调用Platform的对应方法进行加解密。对于其i他的数据,由于加解密对于系统性能有一定影响,所以用户可以自行选择是否使用加密狗等硬件设备进行加解密。

实现

  • 登陆校验
            //密码加密
            string desPassword = SecurityHelper.DESEncrypt(TxtPassword.Text);
            //判断用户名与密码

            CommonService.CommonClient loginHelper = new CommonService.CommonClient();
            bool result = loginHelper.CheckPassword(this.TxtAccount.Text.Trim(), desPassword);
            loginHelper.Close();
  • 连接串加密
<configuration>
  <appSettings>
    <!--是否加密-->
    <add key="Encrypt" value="0" />
  </appSettings>
  <connectionStrings>
    <add name="PlatformConnString" connectionString="*"/>
    <add name="BusinessConnString" connectionString="*"/>
  </connectionStrings>
</configuration>

0表示不使用加密,1表示使用加密。另外系统中还有个小工具实现数据的加密和解密。

原文地址:https://www.cnblogs.com/zyizyizyi/p/2668992.html