From 1b88b169fa5172f6a32f7e3cf9a1094180c65188 Mon Sep 17 00:00:00 2001 From: Stephen Rees-Carter Date: Sat, 23 Sep 2023 01:05:38 +1000 Subject: [PATCH] Increase bcrypt rounds to 12 (#48494) --- src/Illuminate/Hashing/BcryptHasher.php | 2 +- tests/Hashing/HasherTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Hashing/BcryptHasher.php b/src/Illuminate/Hashing/BcryptHasher.php index 26f928cb5708..f74edab88805 100755 --- a/src/Illuminate/Hashing/BcryptHasher.php +++ b/src/Illuminate/Hashing/BcryptHasher.php @@ -12,7 +12,7 @@ class BcryptHasher extends AbstractHasher implements HasherContract * * @var int */ - protected $rounds = 10; + protected $rounds = 12; /** * Indicates whether to perform an algorithm check. diff --git a/tests/Hashing/HasherTest.php b/tests/Hashing/HasherTest.php index 19a33b93d84f..3559cc0303d3 100755 --- a/tests/Hashing/HasherTest.php +++ b/tests/Hashing/HasherTest.php @@ -54,6 +54,7 @@ public function testBasicBcryptHashing() $this->assertFalse($hasher->needsRehash($value)); $this->assertTrue($hasher->needsRehash($value, ['rounds' => 1])); $this->assertSame('bcrypt', password_get_info($value)['algoName']); + $this->assertGreaterThanOrEqual(12, password_get_info($value)['options']['cost']); $this->assertTrue($this->hashManager->isHashed($value)); }