SpringSecurity中使用 BCryptPasswordEncoder 加密及解密

SpringSecurity中使用 BCryptPasswordEncoder 加密及解密

1.加密

new BCryptPasswordEncoder().encode(明文密码);

相同密码每次加密的结果都不同.具体原因不做详细解释(盐值原因)

2.匹配

Boolean bool = bCryptPasswordEncoder.matches(明文输入的密码,加密后的密码);

猜你喜欢

转载自blog.csdn.net/AKALXH/article/details/115395170