2023-02-16 15:28:15 +08:00

28 lines
731 B
Java

package com.zhgd.xmgl.util;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.symmetric.AES;
import java.nio.charset.StandardCharsets;
/**
* @program: wisdomSite
* @description: AES加密
* @author: Mr.Peng
* @create: 2021-08-24 15:24
**/
public class AesUtils {
private static String key="qnLH94zpUIpGu19f";
public static String decryptData(String code) {
// 我们采用 hutool 的 AES 对称加密类进行加解密,具体请参考 https://hutool.cn/
AES aes = SecureUtil.aes(key.getBytes(StandardCharsets.UTF_8));
return aes.decryptStr(code);
}
public static void main(String[] args) {
System.out.println(decryptData("Bng17a2KbxIa5hdGi8j2yA==#"));
}
}