acgranter/acgranter-symfony-hasher
acgranter-symfony-hasher package is a Symfony-compatible password hashing utility, designed to integrate with Symfony’s security component. While the package is named for Symfony, its core functionality (hashing/password verification) is language-agnostic and can be leveraged in Laravel via Symfony’s PasswordHasherInterface or standalone hashing logic.Hash facade already provides robust hashing (using Symfony’s PasswordHasher under the hood).Argon2id with specific parameters) are needed beyond Laravel’s defaults.acgranter/acgranter (a Symfony ACL package).security-crypto component, which is not a direct Laravel dependency. Laravel’s Hash facade already includes this, but the package’s API may not align perfectly with Laravel’s conventions.SymfonyHasher (main class) implements PasswordHasherInterface.Hash::make() with SymfonyHasher::hashPassword() (if custom hashing is required).Illuminate\Contracts\Hashing\Hasher interface for seamless integration.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| API Inconsistency | Medium | Abstract behind a Laravel-compatible facade. |
| Unnecessary Bloat | Low | Only adopt if Symfony interop is critical. |
| Maintenance Gap | Medium | Monitor for Symfony security updates. |
| Performance Impact | Low | Benchmark against Laravel’s native hasher. |
Why Symfony-Specific Hashing?
Hash facade not meet requirements (e.g., custom Argon2 parameters)?Integration Depth
Long-Term Viability
acgranter/acgranter actively maintained? (Low stars/dependents are a red flag.)spatie/laravel-password-hashing)?Security Implications
bcrypt, argon2id)?Hash facade is more mature and integrated.acgranter/acgranter ACL package).Assessment Phase:
Hash::make(), Auth::attempt()).Hash::make() vs. SymfonyHasher::hashPassword() for consistency.Proof of Concept (PoC):
Illuminate\Contracts\Hashing\Hasher that delegates to SymfonyHasher.use Acgranter\SymfonyHasher\SymfonyHasher as AcgranterHasher;
use Illuminate\Contracts\Hashing\Hasher as LaravelHasher;
class AcgranterLaravelHasher implements LaravelHasher {
public function make($value, array $options = []): string {
return (new AcgranterHasher())->hashPassword($value, $options);
}
// Implement other LaravelHasher methods...
}
Hash::extend().Phased Rollout:
Hash::make() in legacy migration paths.| Component | Compatibility Status | Notes |
|---|---|---|
| Laravel Hash Facade | Low | API mismatch; requires wrapper. |
| Symfony PasswordHasher | High | Underlying logic is identical. |
| Laravel Auth System | Medium | May need adjustments for remember_token. |
| Password Reset Logic | Low | Tokens may need re-hashing. |
Hash service provider with a custom one that initializes SymfonyHasher.config/hash.php (if using custom parameters).make()/check() methods match Laravel’s behavior.Auth::attempt() and password resets.security-crypto to Laravel’s stack.password-hasher).acgranter/acgranter if used for ACLs.Hash later may require re-hashing all passwords.SymfonyHasher doesn’t bypass Laravel’s cache (e.g., Hash::driver()).remember_token and password fields.| Scenario | Impact | Mitigation |
|---|---|---|
| Hashing Algorithm Mismatch | Auth failures, locked accounts. | Test with existing hashes pre-deploy. |
| Symfony Security Update | Broken hashing (e.g., BCrypt deprecation). | Monitor Symfony changelogs. |
| Dependency Conflict | Symfony version clashes. | Use replace in composer.json. |
| Performance Regression | Slow hashing under load. | Benchmark vs. Laravel’s Hash. |
How can I help you explore Laravel packages today?