From b994f7047deb8c3224ad1f59eb495a6ffcbc59bf Mon Sep 17 00:00:00 2001 From: Guoqs Date: Wed, 27 Mar 2024 15:46:49 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=B7=BB=E5=8A=A0util=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsowell/thirdparty/lianlian/util/Cryptos.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/Cryptos.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/Cryptos.java index df4b2aa55..d3cc04d12 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/Cryptos.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/util/Cryptos.java @@ -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加密原始字符串. *