Skip to content

Commit a705ff5

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: [Security] update description of password hasher config
2 parents ea10190 + 9a75dea commit a705ff5

File tree

2 files changed

+32
-23
lines changed

2 files changed

+32
-23
lines changed

deployment.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ How to Deploy a Symfony Application
77
===================================
88

99
Deploying a Symfony application can be a complex and varied task depending on
10-
the setup and the requirements of your application. This article is not a step-
11-
by-step guide, but is a general list of the most common requirements and ideas
12-
for deployment.
10+
the setup and the requirements of your application. This article is not a
11+
step-by-step guide, but is a general list of the most common requirements and
12+
ideas for deployment.
1313

1414
.. _symfony2-deployment-basics:
1515

reference/configuration/security.rst

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -319,34 +319,27 @@ hashing algorithm. Also, each algorithm defines different config options:
319319
;
320320
};
321321
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:
325324

326-
Using the Sodium Password Hasher
325+
Using the "auto" Password Hasher
327326
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
328327

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.
331331

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).
337335

338-
.. _reference-security-encoder-auto:
339-
.. _using-the-auto-password-encoder:
336+
.. _reference-security-encoder-bcrypt:
340337

341-
Using the "auto" Password Hasher
338+
Using the Bcrypt Password Hasher
342339
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
343340

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
350343
allocate enough space for them to be persisted. Also, passwords include the
351344
`cryptographic salt`_ inside them (it's generated automatically for each new
352345
password) so you don't have to deal with it.
@@ -367,6 +360,22 @@ used back when they were hashed.
367360
the cost to ``4``, which is the minimum value allowed, in the ``test``
368361
environment configuration.
369362

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+
370379
.. _reference-security-pbkdf2:
371380
.. _using-the-pbkdf2-encoder:
372381

0 commit comments

Comments
 (0)