update 添加util方法

This commit is contained in:
2024-03-27 15:46:49 +08:00
parent d9cf77c7c0
commit b994f7047d

View File

@@ -115,6 +115,18 @@ public class Cryptos {
return aes(input, key, Cipher.ENCRYPT_MODE);
}
/**
* 加密
* @param input
* @param key
* @param iv
* @return
*/
public static String aesEncrypt(String input, String key, String iv) {
byte[] aes = aes(input.getBytes(), key.getBytes(), iv.getBytes(), Cipher.ENCRYPT_MODE);
return Encodes.encodeBase64(aes);
}
/**
* 使用AES加密原始字符串.
*