diff --git a/app/config/collections/common.php b/app/config/collections/common.php index 804929fcfd..eebc11e17f 100644 --- a/app/config/collections/common.php +++ b/app/config/collections/common.php @@ -1,6 +1,5 @@ 256, 'signed' => true, 'required' => false, - 'default' => (new Argon2())->getName(), + 'default' => 'argon2', 'array' => false, 'filters' => [], ], @@ -184,7 +183,7 @@ return [ 'size' => 65535, 'signed' => true, 'required' => false, - 'default' => (new Argon2())->getOptions(), + 'default' => ['type' => 'argon2', 'memoryCost' => 2048, 'timeCost' => 4, 'threads' => 3], 'array' => false, 'filters' => ['json'], ], diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index eaa814efad..1dfa5c2603 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -351,9 +351,9 @@ App::post('/v1/users/argon2') ->action(function (string $userId, string $email, string $password, string $name, Response $response, Document $project, Database $dbForProject, Hooks $hooks) { $argon2 = new Argon2(); $argon2 - ->setMemoryCost(7168) - ->setTimeCost(5) - ->setThreads(1); + ->setMemoryCost(2048) + ->setTimeCost(4) + ->setThreads(3); $user = createUser($argon2, $userId, $email, $password, null, $name, $project, $dbForProject, $hooks); @@ -1379,9 +1379,9 @@ App::patch('/v1/users/:userId/password') // Create Argon2 hasher with default settings $hasher = new Argon2(); $hasher - ->setMemoryCost(7168) - ->setTimeCost(5) - ->setThreads(1); + ->setMemoryCost(2048) + ->setTimeCost(4) + ->setThreads(3); $newPassword = $hasher->hash($password); diff --git a/app/init/resources.php b/app/init/resources.php index 4087d102ca..48a6a102e3 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -983,9 +983,9 @@ App::setResource('store', function (): Store { App::setResource('proofForPassword', function (): Password { $hash = new Argon2(); $hash - ->setMemoryCost(7168) - ->setTimeCost(5) - ->setThreads(1); + ->setMemoryCost(2048) + ->setTimeCost(4) + ->setThreads(3); $password = new Password(); $password