提交 324fc0f9 编写于 作者: JEECG低代码平台's avatar JEECG低代码平台

JeecgBoot 2.0.2 版本发布

上级 ad2fe4a2
......@@ -13,7 +13,6 @@ public class AesEncryptUtil {
//使用AES-128-CBC加密模式,key需要为16位,key和iv可以相同!
private static String KEY = EncryptedString.key;
private static String IV = EncryptedString.iv;
/**
......@@ -45,7 +44,7 @@ public class AesEncryptUtil {
cipher.init(Cipher.ENCRYPT_MODE, keyspec, ivspec);
byte[] encrypted = cipher.doFinal(plaintext);
return new Base64().encodeToString(encrypted);
return Base64.encodeToString(encrypted);
} catch (Exception e) {
e.printStackTrace();
......@@ -63,7 +62,7 @@ public class AesEncryptUtil {
*/
public static String desEncrypt(String data, String key, String iv) throws Exception {
try {
byte[] encrypted1 = new Base64().decode(data);
byte[] encrypted1 = Base64.decode(data);
Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
SecretKeySpec keyspec = new SecretKeySpec(key.getBytes(), "AES");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册