public class AESUtil extends Object
字符集:UTF-8 算法模式:ECB 数据块:128位 补码方式:PKCS5Padding 加密结果编码方式:Base64
| 构造器和说明 |
|---|
AESUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
decrypt(byte[] data,
String password)
解密
|
static String |
decryptFromBase64String(String base64String,
String password)
文本解密
|
static byte[] |
encrypt(byte[] data,
String password)
加密
|
static String |
encryptToBase64String(String content,
String password)
文本加密
|
static SecretKey |
getSecretKey(String password) |
public static byte[] encrypt(byte[] data,
String password)
throws Exception
data - 待加密数据password - 密码Exceptionpublic static byte[] decrypt(byte[] data,
String password)
throws Exception
data - 待解密数据password - 密码Exceptionpublic static String encryptToBase64String(String content, String password) throws Exception
content - 明文password - 密码ExceptionCopyright © 2021. All Rights Reserved.