我在config / initializers / devise.rb中看到,有一个名为“config.stretches”的配置.
# ==> Configuration for :database_authenticatable # For bcrypt,this is the cost for hashing the password and defaults to 10. If # using other encryptors,it sets how many times you want the password re-encrypted. config.stretches = 10
我不明白延伸是什么意思.它说这是我想要密码“重新加密”的时间.为什么和我们的密码将被重新加密?为什么我要指定一个“时代”?
解决方法
简短的回答是它使暴力字典攻击需要更长时间.
This blog post用相当简单的英语写成,可能会让你更好地了解正在发生的事情.