(improvement)(common) Remove AESUtil and add AES/CBC、AES/ECB encryption/decryption in AESEncryptionUtil (#1297)

Co-authored-by: lxwcodemonkey
This commit is contained in:
LXW
2024-06-30 16:18:31 +08:00
committed by GitHub
parent 5132b77953
commit d8bc6a02a4
8 changed files with 155 additions and 157 deletions

View File

@@ -1,6 +1,6 @@
package com.tencent.supersonic.util;
import com.tencent.supersonic.auth.authentication.utils.AESEncryptionUtil;
import com.tencent.supersonic.common.util.AESEncryptionUtil;
public class AESEncryptionUtilTest {
@@ -31,5 +31,19 @@ public class AESEncryptionUtilTest {
String password2 = AESEncryptionUtil.encrypt("zhangsan1234", decodeSalt);
System.out.println("password2: " + password2);
String content = "123";
System.out.println("before AES/CBC encrypt" + content);
String encrypt = AESEncryptionUtil.aesEncryptCBC(content);
System.out.println("after AES/CBC encrypt" + encrypt);
String decrypt = AESEncryptionUtil.aesDecryptCBC(encrypt);
System.out.println("after AES/CBC decrypt" + decrypt);
String str = "123";
System.out.println("before AES/ECB encrypt" + str);
String encryptStr = AESEncryptionUtil.aesEncryptECB(str);
System.out.println("after AES/ECB encrypt" + encryptStr);
String decryptStr = AESEncryptionUtil.aesDecryptECB(encryptStr);
System.out.println("after AES/ECB decrypt" + decryptStr);
}
}