From be45e94c3912aa40c1d2ace060f91da23e15bd10 Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Wed, 26 Mar 2025 19:21:09 +0100 Subject: [PATCH] chore(config): switch from bcrypt to argon2id --- config/hashing.php | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 config/hashing.php diff --git a/config/hashing.php b/config/hashing.php new file mode 100644 index 000000000..a281028cd --- /dev/null +++ b/config/hashing.php @@ -0,0 +1,68 @@ + env('HASH_DRIVER', 'argon2id'), + + /* + |-------------------------------------------------------------------------- + | Bcrypt Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Bcrypt algorithm. This will allow you + | to control the amount of time it takes to hash the given password. + | + */ + + 'bcrypt' => [ + 'rounds' => env('BCRYPT_ROUNDS', 14), + 'verify' => env('HASH_VERIFY', true), + 'limit' => env('BCRYPT_LIMIT', null), + ], + + /* + |-------------------------------------------------------------------------- + | Argon Options + |-------------------------------------------------------------------------- + | + | Here you may specify the configuration options that should be used when + | passwords are hashed using the Argon algorithm. These will allow you + | to control the amount of time it takes to hash the given password. + | + */ + + 'argon' => [ + 'memory' => env('ARGON_MEMORY', 131072), + 'threads' => env('ARGON_THREADS', 1), + 'time' => env('ARGON_TIME', 6), + 'verify' => env('HASH_VERIFY', true), + ], + + /* + |-------------------------------------------------------------------------- + | Rehash On Login + |-------------------------------------------------------------------------- + | + | Setting this option to true will tell Laravel to automatically rehash + | the user's password during login if the configured work factor for + | the algorithm has changed, allowing graceful upgrades of hashes. + | + */ + + 'rehash_on_login' => true, +];