20steps/bricks-scrypt-password-encoder-bundle
Illuminate\Hashing) uses a different abstraction layer, requiring a wrapper or adapter layer.bcrypt (via hash::make()). If security hardening is a priority (e.g., high-value user data, regulatory compliance), this is a compelling fit.ScryptPasswordEncoder logic or a custom facade.scrypt-php library, which must be compatible with Laravel’s PHP version (8.0+). Test for:
SecurityBundle integration (e.g., encoder_factory, user_provider).ParameterBag for configuration (Laravel uses config() or environment variables).Hash facade or extend Illuminate\Contracts\Hashing\Hasher with a custom scrypt implementation.users table migration to store scrypt hashes (longer format than bcrypt).UserInterface assumes a specific encoder contract; Laravel’s Illuminate\Auth\Authenticatable may need adjustments.N, r, p parameters).scrypt-php stability in Laravel’s environment.N, r, p parameters for scrypt? (Default: N=16384, r=8, p=1?)ScryptPasswordEncoder class from the Symfony bundle and wrap it in a Laravel-compatible trait/interface (e.g., Illuminate\Contracts\Hashing\Hasher).class ScryptHasher implements Hasher {
public function make($value, array $options) {
return (new ScryptPasswordEncoder($options))->encodePassword($value, null);
}
// ... other Hasher methods
}
SymfonyBridge (e.g., spatie/laravel-symfony-support) to integrate the bundle as a service provider.tarcieri/scrypt-php (PHP extension or pure-PHP polyfill).ext-sodium is unavailable (scrypt-php falls back to pure-PHP).ScryptPasswordEncoder and test in a Laravel app:
Hash::make().config/auth.php to use the new hasher:
'hashers' => [
'scrypt' => App\Hashing\ScryptHasher::class,
],
hash_algorithm column to users table (e.g., bcrypt/scrypt).Hasher that routes to bcrypt/scrypt based on the column.Hash::make() calls to use scrypt.$scrypt$N=16384$r=8$p=1$... vs. $2y$...).password column can accommodate 128+ character hashes.tarcieri/scrypt-php to composer.json:
"require": {
"tarcieri/scrypt-php": "^2.0"
}
scrypt parameters in .env:
SCRYPT_N=16384
SCRYPT_R=8
SCRYPT_P=1
Hasher class (see Stack Fit).AuthServiceProvider:
public function boot() {
Hash::extend('scrypt', function ($app) {
return new ScryptHasher($app['config']['hashing']);
});
}
scrypt-php.N, r, p parameters and their security/performance tradeoffs..env for flexibility.scrypt-php internals.N parameter) may require:
users table growth.N/r/p values reduce scrypt’s effectiveness. Validate defaults against OWASP guidelines.ext-sodium is unavailable if relying on it.How can I help you explore Laravel packages today?