Symfony Security编码器的'auto'算法可以改变编码方式吗?
Can the 'auto' algorithm of the Symfony Security encoder change encoding method?
在Symfony 4.3中,recommended使用编码算法的auto
选项:
# config/packages/security.yaml
security:
# ...
encoders:
# use your user class name here
App\Entity\User:
# Use native password encoder
# This value auto-selects the best possible hashing algorithm.
algorithm: auto
我的问题是关于上面代码中的注释:如果 "best possible" 算法改变,算法会改变吗?如果是这样,这将如何影响当前存储的密码?
是的。
根据这个 comment 关于 Symfony Github 存储库上的一个问题:
[安全] 4.3 始终 "Bad credentials." 算法 "auto"
sodium can't validate bcrypt passwords, that's the issue.
of course you can't move from sha512 to auto/native/sodium without a migration plan (one will be provide in 4.4)
估计libsodium会保证兼容性。
所以我想密码已经用以前的 "best possible" 算法散列的用户将能够登录,但是他们的密码将 NOT 用新的 "best possible" 重新散列]算法。
对于使用 libsodium 不支持的算法进行哈希处理的密码(例如 bcrypt),如果您 NOT 用户将无法登录不要具体告诉 Symfony 为这些用户使用哪个编码器。
请参阅 https://symfony.com/doc/current/security/named_encoders.html 中的 getEncoderName()
方法,了解如何处理多个编码器并告诉 Symfony 使用哪一个。
在Symfony 4.3中,recommended使用编码算法的auto
选项:
# config/packages/security.yaml
security:
# ...
encoders:
# use your user class name here
App\Entity\User:
# Use native password encoder
# This value auto-selects the best possible hashing algorithm.
algorithm: auto
我的问题是关于上面代码中的注释:如果 "best possible" 算法改变,算法会改变吗?如果是这样,这将如何影响当前存储的密码?
是的。
根据这个 comment 关于 Symfony Github 存储库上的一个问题:
[安全] 4.3 始终 "Bad credentials." 算法 "auto"
sodium can't validate bcrypt passwords, that's the issue. of course you can't move from sha512 to auto/native/sodium without a migration plan (one will be provide in 4.4)
估计libsodium会保证兼容性。 所以我想密码已经用以前的 "best possible" 算法散列的用户将能够登录,但是他们的密码将 NOT 用新的 "best possible" 重新散列]算法。
对于使用 libsodium 不支持的算法进行哈希处理的密码(例如 bcrypt),如果您 NOT 用户将无法登录不要具体告诉 Symfony 为这些用户使用哪个编码器。
请参阅 https://symfony.com/doc/current/security/named_encoders.html 中的 getEncoderName()
方法,了解如何处理多个编码器并告诉 Symfony 使用哪一个。