@@ -319,34 +319,27 @@ hashing algorithm. Also, each algorithm defines different config options:
319
319
;
320
320
};
321
321
322
- .. _reference-security-sodium :
323
- .. _using-the-argon2i-password-encoder :
324
- .. _using-the-sodium-password-encoder :
322
+ .. _reference-security-encoder-auto :
323
+ .. _using-the-auto-password-encoder :
325
324
326
- Using the Sodium Password Hasher
325
+ Using the "auto" Password Hasher
327
326
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
328
327
329
- It uses the `Argon2 key derivation function `_ and it's the hasher recommended
330
- by Symfony.
328
+ It automatically selects the best available hasher. Starting from Symfony 5.3,
329
+ it uses the Bcrypt hasher. If PHP or Symfony adds new password hashers in the
330
+ future, it might select a different hasher.
331
331
332
- The hashed passwords are ``96 `` characters long, but due to the hashing
333
- requirements saved in the resulting hash this may change in the future, so make
334
- sure to allocate enough space for them to be persisted. Also, passwords include
335
- the `cryptographic salt `_ inside them (it's generated automatically for each new
336
- password) so you don't have to deal with it.
332
+ Because of this, the length of the hashed passwords may change in the future, so
333
+ make sure to allocate enough space for them to be persisted (``varchar(255) ``
334
+ should be a good setting).
337
335
338
- .. _reference-security-encoder-auto :
339
- .. _using-the-auto-password-encoder :
336
+ .. _reference-security-encoder-bcrypt :
340
337
341
- Using the "auto" Password Hasher
338
+ Using the Bcrypt Password Hasher
342
339
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
343
340
344
- It selects automatically the best possible hasher. Currently, it tries to use
345
- Sodium by default and falls back to the `bcrypt password hashing function `_ if
346
- not possible. In the future, when PHP adds new hashing techniques, it may use
347
- different password hashers.
348
-
349
- It produces hashed passwords with ``60 `` characters long, so make sure to
341
+ It produces hashed passwords with the `bcrypt password hashing function `_.
342
+ Hashed passwords are ``60 `` characters long, so make sure to
350
343
allocate enough space for them to be persisted. Also, passwords include the
351
344
`cryptographic salt `_ inside them (it's generated automatically for each new
352
345
password) so you don't have to deal with it.
@@ -367,6 +360,22 @@ used back when they were hashed.
367
360
the cost to ``4 ``, which is the minimum value allowed, in the ``test ``
368
361
environment configuration.
369
362
363
+ .. _reference-security-sodium :
364
+ .. _using-the-argon2i-password-encoder :
365
+ .. _using-the-sodium-password-encoder :
366
+
367
+ Using the Sodium Password Hasher
368
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
369
+
370
+ It uses the `Argon2 key derivation function `_. Argon2 support was introduced
371
+ in PHP 7.2 by bundeling the `libsodium `_ extension.
372
+
373
+ The hashed passwords are ``96 `` characters long, but due to the hashing
374
+ requirements saved in the resulting hash this may change in the future, so make
375
+ sure to allocate enough space for them to be persisted. Also, passwords include
376
+ the `cryptographic salt `_ inside them (it's generated automatically for each new
377
+ password) so you don't have to deal with it.
378
+
370
379
.. _reference-security-pbkdf2 :
371
380
.. _using-the-pbkdf2-encoder :
372
381
0 commit comments