7

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

どういう意味かわかりませんstretches。パスワードを「再暗号化」したいときだと書いてあります。なぜ、私たちのパスワードは再暗号化されるのですか?そして、なぜ「時間」を指定する必要があるのですか?

4

2 に答える 2

9

簡単に言うと、ブルートフォース辞書攻撃に時間がかかるということです。

このブログ投稿は適度にわかりやすい英語で書かれており、何が起こっているのかをよりよく理解できるかもしれません。

于 2010-07-03T05:07:31.240 に答える