mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-21 06:04:19 +08:00
(improvement)(common) Remove AESUtil and add AES/CBC、AES/ECB encryption/decryption in AESEncryptionUtil (#1297)
Co-authored-by: lxwcodemonkey
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user