diff options
Diffstat (limited to 'Core/Encoder/MessageDigestPasswordEncoder.php')
-rw-r--r-- | Core/Encoder/MessageDigestPasswordEncoder.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Core/Encoder/MessageDigestPasswordEncoder.php b/Core/Encoder/MessageDigestPasswordEncoder.php index 811dd4c..b69cf6e 100644 --- a/Core/Encoder/MessageDigestPasswordEncoder.php +++ b/Core/Encoder/MessageDigestPasswordEncoder.php @@ -3,7 +3,7 @@ /* * This file is part of the Symfony package. * - * (c) Fabien Potencier <fabien.potencier@symfony-project.com> + * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -14,7 +14,7 @@ namespace Symfony\Component\Security\Core\Encoder; /** * MessageDigestPasswordEncoder uses a message digest algorithm. * - * @author Fabien Potencier <fabien.potencier@symfony-project.com> + * @author Fabien Potencier <fabien@symfony.com> */ class MessageDigestPasswordEncoder extends BasePasswordEncoder { @@ -28,7 +28,7 @@ class MessageDigestPasswordEncoder extends BasePasswordEncoder * @param Boolean $encodeHashAsBase64 Whether to base64 encode the password hash * @param integer $iterations The number of iterations to use to stretch the password hash */ - public function __construct($algorithm = 'sha256', $encodeHashAsBase64 = false, $iterations = 1) + public function __construct($algorithm = 'sha512', $encodeHashAsBase64 = true, $iterations = 5000) { $this->algorithm = $algorithm; $this->encodeHashAsBase64 = $encodeHashAsBase64; @@ -49,7 +49,7 @@ class MessageDigestPasswordEncoder extends BasePasswordEncoder // "stretch" hash for ($i = 1; $i < $this->iterations; $i++) { - $digest = hash($this->algorithm, $digest, true); + $digest = hash($this->algorithm, $digest.$salted, true); } return $this->encodeHashAsBase64 ? base64_encode($digest) : bin2hex($digest); |