mirror of
https://gitee.com/republicline/rax-remote-v2.git
synced 2025-08-24 06:14:56 +08:00
登录密码解码
This commit is contained in:
parent
23e1470ea6
commit
a4adf0e6da
16
auth/pom.xml
16
auth/pom.xml
|
@ -54,10 +54,18 @@
|
|||
</dependency>
|
||||
|
||||
<!-- 使用Hutool工具库中的加密模块 -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-crypto</artifactId>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-crypto -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-crypto</artifactId>
|
||||
<version>5.8.27</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk15to18</artifactId>
|
||||
<version>1.68</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -206,7 +206,9 @@ public class RaxDaoAuthenticationProvider extends AbstractUserDetailsAuthenticat
|
|||
// 构建前端对应解密AES 因子
|
||||
String key = SpringContextHolder.getBean(Environment.class)
|
||||
.getProperty("gateway.encodeKey", "raxsraxsraxsraxs");
|
||||
AES aes = new AES(Mode.CFB, Padding.NoPadding, new SecretKeySpec(key.getBytes(), "AES"),
|
||||
/*AES aes = new AES(Mode.CFB, Padding.PKCS5Padding, new SecretKeySpec(key.getBytes(), "AES"),
|
||||
new IvParameterSpec(key.getBytes()));*/
|
||||
AES aes = new AES("CBC", "PKCS7Padding", new SecretKeySpec(key.getBytes(), "AES"),
|
||||
new IvParameterSpec(key.getBytes()));
|
||||
return aes.decryptStr(presentedPassword);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user