浏览代码

修改Encrypt3DES加密模式

lcl 8 月之前
父节点
当前提交
dca4485381
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Common/dbconn.cs

+ 1 - 1
Common/dbconn.cs

@@ -78,7 +78,7 @@ namespace Common
             DESCryptoServiceProvider DES = new DESCryptoServiceProvider();
             DES.Key = Encoding.UTF8.GetBytes(Key3des);
             DES.Mode = CipherMode.ECB;
-            DES.Padding = PaddingMode.Zeros;
+            DES.Padding = PaddingMode.PKCS7;
             ICryptoTransform DESEncrypt = DES.CreateEncryptor();
             byte[] Buffer = Encoding.UTF8.GetBytes(a_strString);
             return Convert.ToBase64String(DESEncrypt.TransformFinalBlock(Buffer, 0, Buffer.Length));