Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 77ee600

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 763a44a + e606210 commit 77ee600

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

book/security.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,9 @@ it as base64. In other words, the password has been greatly obfuscated so
12001200
that the hashed password can't be decoded (i.e. you can't determine the password
12011201
from the hashed password).
12021202

1203+
.. versionadded:: 2.2
1204+
As of Symfony 2.2 you can also use the PBKDF2 password encoder.
1205+
12031206
If you have some sort of registration form for users, you'll need to be able
12041207
to determine the hashed password so that you can set it on your user. No
12051208
matter what algorithm you configure for your user object, the hashed password

reference/configuration/security.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ Each part will be explained in the next section.
5555
encode_as_base64: true
5656
iterations: 5000
5757
58+
# PBKDF2 encoder
59+
Acme\Your\Class\Name:
60+
algorithm: pbkdf2
61+
hash_algorithm: sha512
62+
encode_as_base64: true
63+
iterations: 1000
64+
5865
# Example options/values for what a custom encoder might look like
5966
Acme\Your\Class\Name:
6067
algorithm: ~
@@ -189,6 +196,17 @@ Each part will be explained in the next section.
189196
ROLE_ADMIN: [ROLE_ORGANIZER, ROLE_USER]
190197
ROLE_SUPERADMIN: [ROLE_ADMIN]
191198
199+
.. caution::
200+
PBKDF2 encoder uses the PBKDF2 (Password-Based Key Derivation Function 2).
201+
202+
Providing a high level of Cryptographic security,
203+
as recommended by the National Institute of Standards and Technology (NIST).
204+
205+
But also warrants a warning, using PBKDF2 (with a high number of iterations) slows down the process.
206+
PBKDF2 should be used with caution and care.
207+
208+
A good configuration lies around at least 1000 iterations and sha512 for the hash algorithm.
209+
192210
.. _reference-security-firewall-form-login:
193211

194212
Form Login Configuration

0 commit comments

Comments
 (0)