@@ -129,12 +129,12 @@ encoding algorithm. Also, each algorithm defines different config options:
129129 # ...
130130
131131 encoders :
132- # bcrypt encoder with default options
133- App\Entity\User : ' bcrypt '
132+ # auto encoder with default options
133+ App\Entity\User : ' auto '
134134
135- # bcrypt encoder with custom options
135+ # auto encoder with custom options
136136 App\Entity\User :
137- algorithm : ' bcrypt '
137+ algorithm : ' auto '
138138 cost : 15
139139
140140 # Sodium encoder with default options
@@ -162,16 +162,16 @@ encoding algorithm. Also, each algorithm defines different config options:
162162
163163 <config >
164164 <!-- ... -->
165- <!-- bcrypt encoder with default options -->
165+ <!-- auto encoder with default options -->
166166 <encoder
167167 class =" App\Entity\User"
168- algorithm =" bcrypt "
168+ algorithm =" auto "
169169 />
170170
171- <!-- bcrypt encoder with custom options -->
171+ <!-- auto encoder with custom options -->
172172 <encoder
173173 class =" App\Entity\User"
174- algorithm =" bcrypt "
174+ algorithm =" auto "
175175 cost =" 15"
176176 />
177177
@@ -209,14 +209,14 @@ encoding algorithm. Also, each algorithm defines different config options:
209209 $container->loadFromExtension('security', [
210210 // ...
211211 'encoders' => [
212- // bcrypt encoder with default options
212+ // auto encoder with default options
213213 User::class => [
214- 'algorithm' => 'bcrypt ',
214+ 'algorithm' => 'auto ',
215215 ],
216216
217- // bcrypt encoder with custom options
217+ // auto encoder with custom options
218218 User::class => [
219- 'algorithm' => 'bcrypt ',
219+ 'algorithm' => 'auto ',
220220 'cost' => 15,
221221 ],
222222
@@ -278,16 +278,20 @@ sure to allocate enough space for them to be persisted. Also, passwords include
278278the `cryptographic salt `_ inside them (it's generated automatically for each new
279279password) so you don't have to deal with it.
280280
281- .. _reference-security-bcrypt :
281+ .. _reference-security-encoder-auto :
282282
283- Using the BCrypt Password Encoder
283+ Using the "auto" Password Encoder
284284~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
285285
286- It uses the `bcrypt password hashing function `_ and it's recommended to use it
287- when it's not possible to use Sodium. The encoded passwords are ``60 ``
288- characters long, so make sure to allocate enough space for them to be persisted.
289- Also, passwords include the `cryptographic salt `_ inside them (it's generated
290- automatically for each new password) so you don't have to deal with it.
286+ It selects automatically the best possible encoder. Currently, it tries to use
287+ Sodium by default and falls back to the `bcrypt password hashing function `_ if
288+ not possible. In the future, when PHP adds new hashing techniques, it may use
289+ different password hashers.
290+
291+ It produces encoded passwords with ``60 `` characters long, so make sure to
292+ allocate enough space for them to be persisted. Also, passwords include the
293+ `cryptographic salt `_ inside them (it's generated automatically for each new
294+ password) so you don't have to deal with it.
291295
292296Its only configuration option is ``cost ``, which is an integer in the range of
293297``4-31 `` (by default, ``13 ``). Each single increment of the cost **doubles the
@@ -311,7 +315,7 @@ Using the PBKDF2 Encoder
311315~~~~~~~~~~~~~~~~~~~~~~~~
312316
313317Using the `PBKDF2 `_ encoder is no longer recommended since PHP added support for
314- Sodium and bcrypt . Legacy application still using it are encouraged to upgrade
318+ Sodium and BCrypt . Legacy application still using it are encouraged to upgrade
315319to those newer encoding algorithms.
316320
317321firewalls
0 commit comments