Commit 9e0819c0a9dda6fe92af4621964445d7346344f7
1 parent
8ef2d228
JeecgBoot 2.0.2 版本发布
Showing
1 changed file
with
2 additions
and
3 deletions
jeecg-boot/jeecg-boot-base-common/src/main/java/org/jeecg/common/util/encryption/AesEncryptUtil.java
... | ... | @@ -13,7 +13,6 @@ public class AesEncryptUtil { |
13 | 13 | |
14 | 14 | //使用AES-128-CBC加密模式,key需要为16位,key和iv可以相同! |
15 | 15 | private static String KEY = EncryptedString.key; |
16 | - | |
17 | 16 | private static String IV = EncryptedString.iv; |
18 | 17 | |
19 | 18 | /** |
... | ... | @@ -45,7 +44,7 @@ public class AesEncryptUtil { |
45 | 44 | cipher.init(Cipher.ENCRYPT_MODE, keyspec, ivspec); |
46 | 45 | byte[] encrypted = cipher.doFinal(plaintext); |
47 | 46 | |
48 | - return new Base64().encodeToString(encrypted); | |
47 | + return Base64.encodeToString(encrypted); | |
49 | 48 | |
50 | 49 | } catch (Exception e) { |
51 | 50 | e.printStackTrace(); |
... | ... | @@ -63,7 +62,7 @@ public class AesEncryptUtil { |
63 | 62 | */ |
64 | 63 | public static String desEncrypt(String data, String key, String iv) throws Exception { |
65 | 64 | try { |
66 | - byte[] encrypted1 = new Base64().decode(data); | |
65 | + byte[] encrypted1 = Base64.decode(data); | |
67 | 66 | |
68 | 67 | Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); |
69 | 68 | SecretKeySpec keyspec = new SecretKeySpec(key.getBytes(), "AES"); |
... | ... |