【问题标题】:Spring security. How salt-source works?春季安全。盐源如何工作?
【发布时间】:2013-12-22 10:46:57
【问题描述】:

所以,我是 Spring Security 的新手。我正在使用盐的密码散列。在安全 xml 文件中,它看起来像:

<beans:bean id="saltSource" class="bla.bla.MyOwnSalt" scope="singleton" />
<password-encoder hash="md5" >
<salt-source ref="saltSource" />

MyOwnSalt 实现 SaltSource。

所以密码哈希是用盐创建的。 有时我需要直接在数据库中创建用户及其密码。 主要问题是:如果我有密码和盐,如何仅使用 MD5 计算器创建哈希?

【问题讨论】:

    标签: hash spring-security passwords md5 salt


    【解决方案1】:

    我试图从“passwordsalt”创建哈希。带有 salt-source 的 Spring 密码编码器的工作方式如下: PasswordEncoder.encode("password{salt}"); 所以,问题出在错过{} 我所要做的就是查看 PasswordEncoder 源代码。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-22
      • 2015-06-02
      • 2014-02-02
      • 2012-12-13
      • 2017-11-30
      • 2021-05-12
      相关资源
      最近更新 更多