Browse Source

修改Encrypt3DES加密模式

lcl 8 months ago
parent
commit
dca4485381
1 changed files with 1 additions and 1 deletions
  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));