File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,10 @@ private static string GetRandomStr(int length)
4343
4444 #region AES
4545
46+ /*
47+ AES:16位密钥=128位,24位密钥=192位,32位密钥=256位,IV均为16位
48+ */
49+
4650 /// <summary>
4751 /// Create ase key
4852 /// </summary>
@@ -239,7 +243,7 @@ public static string AESEncrypt(string data, string key)
239243
240244 aes . Mode = CipherMode . ECB ;
241245 aes . Padding = PaddingMode . PKCS7 ;
242- aes . KeySize = 128 ;
246+ aes . KeySize = 256 ;
243247 aes . Key = bKey ;
244248
245249 using ( CryptoStream cryptoStream = new CryptoStream ( Memory , aes . CreateEncryptor ( ) , CryptoStreamMode . Write ) )
@@ -281,7 +285,7 @@ public static string AESDecrypt(string data, string key)
281285 {
282286 aes . Mode = CipherMode . ECB ;
283287 aes . Padding = PaddingMode . PKCS7 ;
284- aes . KeySize = 128 ;
288+ aes . KeySize = 256 ;
285289 aes . Key = bKey ;
286290
287291 using ( CryptoStream cryptoStream = new CryptoStream ( Memory , aes . CreateDecryptor ( ) , CryptoStreamMode . Read ) )
You can’t perform that action at this time.
0 commit comments