Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Security] Update description of password hasher config #15430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 30 additions & 21 deletions 51 reference/configuration/security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,35 +319,28 @@ hashing algorithm. Also, each algorithm defines different config options:
;
};

.. _reference-security-sodium:
.. _using-the-argon2i-password-encoder:
.. _using-the-sodium-password-encoder:

Using the Sodium Password Hasher
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It uses the `Argon2 key derivation function`_ and it's the hasher recommended
by Symfony. Argon2 support was introduced in PHP 7.2, but if you use an earlier
PHP version, you can install the `libsodium`_ PHP extension.

The hashed passwords are ``96`` characters long, but due to the hashing
requirements saved in the resulting hash this may change in the future, so make
sure to allocate enough space for them to be persisted. Also, passwords include
the `cryptographic salt`_ inside them (it's generated automatically for each new
password) so you don't have to deal with it.

.. _reference-security-encoder-auto:
.. _using-the-auto-password-encoder:

Using the "auto" Password Hasher
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It selects automatically the best possible hasher. Currently, it tries to use
Sodium by default and falls back to the `bcrypt password hashing function`_ if
not possible. In the future, when PHP adds new hashing techniques, it may use
different password hashers.
It automatically selects the best available hasher. Starting from Symfony 5.3,
it uses the Bcrypt Password Hasher. If PHP or Symfony adds new Password Hashers
in the future, it might select a different hasher.

Because of this, the length of the hashed passwords may change in the future
(if the "auto" implementation changes), so make sure to allocate enough space
for them to be persisted. ``varchar(255)`` should be a good setting.

It produces hashed passwords with ``60`` characters long, so make sure to
.. _reference-security-encoder-bcrypt:

Using the Bcrypt Password Hasher
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It produces hashed passwords with the `bcrypt password hashing function`_.
Hashed passwords are ``60`` characters long, so make sure to
allocate enough space for them to be persisted. Also, passwords include the
`cryptographic salt`_ inside them (it's generated automatically for each new
password) so you don't have to deal with it.
Expand All @@ -368,6 +361,22 @@ used back when they were hashed.
the cost to ``4``, which is the minimum value allowed, in the ``test``
environment configuration.

.. _reference-security-sodium:
.. _using-the-argon2i-password-encoder:
.. _using-the-sodium-password-encoder:

Using the Sodium Password Hasher
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It uses the `Argon2 key derivation function`_. Argon2 support was introduced
in PHP 7.2 by bundeling the `libsodium`_ extension.

The hashed passwords are ``96`` characters long, but due to the hashing
requirements saved in the resulting hash this may change in the future, so make
sure to allocate enough space for them to be persisted. Also, passwords include
the `cryptographic salt`_ inside them (it's generated automatically for each new
password) so you don't have to deal with it.

.. _reference-security-pbkdf2:
.. _using-the-pbkdf2-encoder:

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.