赞
踩
点击上方 Java老铁,并选择 设为星标
优质文章和资料会及时送达
任何应用考虑到安全,绝不能明文的方式保存密码。密码应该通过哈希算法进行加密。
有很多标准的算法比如SHA或者MD5,结合salt(盐)是一个不错的选择。Spring Security
提供了BCryptPasswordEncoder类,实现Spring的PasswordEncoder接口使用BCrypt强
哈希方法来加密密码。BCrypt强哈希方法 每次加密的结果都不一样。
- <dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-security</artifactId>
- </dependency>
我们在添
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。