登录密码解码
This commit is contained in:
parent
23e1470ea6
commit
a4adf0e6da
16
auth/pom.xml
16
auth/pom.xml
|
@ -54,10 +54,18 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 使用Hutool工具库中的加密模块 -->
|
<!-- 使用Hutool工具库中的加密模块 -->
|
||||||
<dependency>
|
<!-- https://mvnrepository.com/artifact/cn.hutool/hutool-crypto -->
|
||||||
<groupId>cn.hutool</groupId>
|
<dependency>
|
||||||
<artifactId>hutool-crypto</artifactId>
|
<groupId>cn.hutool</groupId>
|
||||||
</dependency>
|
<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>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -206,7 +206,9 @@ public class RaxDaoAuthenticationProvider extends AbstractUserDetailsAuthenticat
|
||||||
// 构建前端对应解密AES 因子
|
// 构建前端对应解密AES 因子
|
||||||
String key = SpringContextHolder.getBean(Environment.class)
|
String key = SpringContextHolder.getBean(Environment.class)
|
||||||
.getProperty("gateway.encodeKey", "raxsraxsraxsraxs");
|
.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()));
|
new IvParameterSpec(key.getBytes()));
|
||||||
return aes.decryptStr(presentedPassword);
|
return aes.decryptStr(presentedPassword);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user