From 3d2ad8811699036931e2c3b443fa6c9e3db0f122 Mon Sep 17 00:00:00 2001 From: zhuyijun Date: Mon, 12 Dec 2022 17:42:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/zyjblogs/server/user/service/impl/LoginServiceImpl.java | 2 +- .../cn/zyjblogs/starter/common/utils/crypto/sm/sm4/SM4.java | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server/zyjblogs-oauth/src/main/java/cn/zyjblogs/server/user/service/impl/LoginServiceImpl.java b/server/zyjblogs-oauth/src/main/java/cn/zyjblogs/server/user/service/impl/LoginServiceImpl.java index df238bd..334991d 100644 --- a/server/zyjblogs-oauth/src/main/java/cn/zyjblogs/server/user/service/impl/LoginServiceImpl.java +++ b/server/zyjblogs-oauth/src/main/java/cn/zyjblogs/server/user/service/impl/LoginServiceImpl.java @@ -94,7 +94,7 @@ public class LoginServiceImpl implements LoginService { @Override public SmsResponse sendLoginCode(String phone) { - int smsCode = RandomUtils.nextInt(10000, 99999); + int smsCode = RandomUtils.nextInt(100000, 999999); String code = redisTemplateHandler.get(CommonRedisKeyConstant.SMS_LOGIN + phone); int count = 1; if (StringUtils.hasLength(code)) { diff --git a/stater/zyjblogs-common-spring-boot-starter/src/main/java/cn/zyjblogs/starter/common/utils/crypto/sm/sm4/SM4.java b/stater/zyjblogs-common-spring-boot-starter/src/main/java/cn/zyjblogs/starter/common/utils/crypto/sm/sm4/SM4.java index a06ec0b..7537a62 100644 --- a/stater/zyjblogs-common-spring-boot-starter/src/main/java/cn/zyjblogs/starter/common/utils/crypto/sm/sm4/SM4.java +++ b/stater/zyjblogs-common-spring-boot-starter/src/main/java/cn/zyjblogs/starter/common/utils/crypto/sm/sm4/SM4.java @@ -190,6 +190,7 @@ public class SM4 { public static void main(String[] args) throws Exception { String iv = SM4.generateKey(); System.out.println(iv); + System.out.println("加密:---------"); String v = SM4.encrypt(iv, """ 晚日照空矶,采莲承晚晖。 风起湖难渡,莲多采未稀。 @@ -199,7 +200,9 @@ public class SM4 { System.out.println(v); String digest = SM3.digest(v); System.out.println(digest); + System.out.println("解密:---------"); System.out.println(SM4.decrypt(iv, v, iv)); + System.out.println("解密:---------"); System.out.println(SM4.decrypt("864669EB9E57E15C923E1003CBEA8872", "6a05d74bda1f2a41c0b47605b06ef638", "fedcba98765432100123456789abcdef")); }