hautelook/phpass
Modernized, namespaced Composer-ready fork of Openwall Phpass (0.3) with minimal stylistic changes and unit tests. Provides PasswordHash to generate and verify password hashes for legacy systems; public domain source.
$2a$ prefix), which is secure and compatible with Laravel’s default bcrypt hashing (via Hash::make()). However, Laravel’s built-in Hash facade already abstracts this, raising the question of redundancy.Hautelook\Phpass) and Composer autoloading, ensuring clean integration into Laravel’s dependency system.Hash facade for niche use cases (e.g., legacy migrations, third-party auth systems).HashPassword() → Equivalent to Laravel’s Hash::make().CheckPassword() → Equivalent to Laravel’s Hash::check().PasswordHash with cost factor and portability flag). No database or external service dependencies.Hash facade already implements bcrypt hashing with additional features (e.g., key derivation, algorithm flexibility). Introducing this package could lead to:
Hash.intval conversion), but no guarantees for future PHP versions (e.g., 8.2+).Hash?
Hash?Hash::check()? (Yes, as both use bcrypt.)Hash::make() generate compatible hashes? (Yes, but may differ in cost factor.)8) optimized for Laravel’s environment?password_hash())?Hash or a maintained alternative like phpass-2.0?)Cache::remember()).Hash).Hash (e.g., hashing speed, memory usage).Hash::make()/Hash::check() with PasswordHash in specific services (e.g., legacy auth endpoints).
// config/app.php
'hash' => [
'driver' => 'phpass', // or 'laravel'
];
Authenticatable if manually implemented (e.g., override setPasswordAttribute).Password::create() with custom hashing logic.laravel/breeze or laravel/sanctum to ensure auth flows remain intact.8) in .env for consistency:
PASSWORD_HASH_COST=8
composer.json and test in isolation.Hash calls in the codebase, starting with non-critical paths.HasApiTokens).Hash behavior.Hash::invalidLastAttempt()).Hash").Hash, this is CPU-intensive by design (good for security, bad for high-throughput systems).Hash (which can leverage parallel option in some contexts), this package processes hashes sequentially.Hash).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Hash format incompatibility | Auth failures | Validate all hashes during migration. |
| PHP version deprecation (e.g., 8.2) | Package breaks | Pin to PHP 8.1 in composer.json. |
| Cost factor mismatch | Brute-force vulnerability | Standardize cost factor (e.g., PASSWORD_BCRYPT_ROUNDS). |
| Fork abandonment | Security vulnerabilities | Plan to migrate to Laravel’s Hash or password_hash(). |
| Concurrent hashing collisions | Race conditions in auth | Use Laravel’s Hash for new features. |
How can I help you explore Laravel packages today?