JeecgBoot 2.0.2 版本发布

This commit is contained in:
zhangdaihao 2019-07-09 16:33:18 +08:00
parent 8ef2d228f2
commit 9e0819c0a9
1 changed files with 2 additions and 3 deletions

View File

@ -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");