From 324fc0f92f4fce73b72888637635459f906196a9 Mon Sep 17 00:00:00 2001 From: zhangdaihao Date: Tue, 9 Jul 2019 16:33:48 +0800 Subject: [PATCH] =?UTF-8?q?JeecgBoot=202.0.2=20=E7=89=88=E6=9C=AC=E5=8F=91?= =?UTF-8?q?=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jeecg/common/util/encryption/AesEncryptUtil.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jeecg-boot/jeecg-boot-base-common/src/main/java/org/jeecg/common/util/encryption/AesEncryptUtil.java b/jeecg-boot/jeecg-boot-base-common/src/main/java/org/jeecg/common/util/encryption/AesEncryptUtil.java index a2820f8..f97868e 100644 --- a/jeecg-boot/jeecg-boot-base-common/src/main/java/org/jeecg/common/util/encryption/AesEncryptUtil.java +++ b/jeecg-boot/jeecg-boot-base-common/src/main/java/org/jeecg/common/util/encryption/AesEncryptUtil.java @@ -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"); -- GitLab