【问题标题】:Password hashing with Spring Security使用 Spring Security 进行密码散列
【发布时间】:2015-02-09 22:03:35
【问题描述】:

是否可以使用 Spring Security BCryptPasswordEncoder 为密码添加额外的盐?

【问题讨论】:

标签: spring spring-security salt bcrypt


【解决方案1】:

您不能将 Bcrypt 算法与自定义盐一起使用,因为在 bcrypt algorithm it always chooses a random salt to encode the password and and then finally it attaches the salt to the encoded password. 这是它的工作原理,这就是您不能在此算法中拥有自己的自定义盐的原因。

即使您收到的错误消息也显示相同的内容。如果您想使用自定义盐源进行加密,则应改为使用 SHA-256 或 MD5 算法。

【讨论】:

    猜你喜欢
    • 2015-04-20
    • 2011-11-14
    • 1970-01-01
    • 2018-12-10
    • 2021-06-04
    • 1970-01-01
    • 2019-09-27
    • 1970-01-01
    • 2020-12-21
    相关资源
    最近更新 更多