Download the PHP package luisinder/blowfish-lib without Composer
On this page you can find all versions of the php package luisinder/blowfish-lib. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package blowfish-lib
blowfish-lib
Simple helper library for hashing and verifying passwords using the Blowfish (bcrypt) algorithm in PHP.
โจ Features
- Secure password hashing via
password_hash()(bcrypt) - Password verification helper
- Configurable cost factor
- Backwards-compatible method names (
crypt_blowfish,checkPassword) retained
๐ฆ Installation
Via Composer (recommended):
Or clone/download and include the file manually:
โ Requirements
- PHP >= 7.4
๐ Usage
Backwards Compatibility
Older code using:
โฆwill still function, but you should migrate to:
An internal class_alias keeps the legacy lowercase blowFish class name available.
Rehashing Strategy
You can detect when to upgrade stored hashes to a higher cost:
โ๏ธ Cost Factor Guidance
Typical values: 10โ14. Higher = more secure but slower. Benchmark in your environment aiming for ~100ms or less per hash for interactive logins.
๐ Security Notes
- Do NOT store plain passwords.
- Always use
password_verify()(wrapped byverifyPassword). - Rotate the cost upwards over time; you can rehash existing hashes with
password_needs_rehash()externally if desired (not included to keep this helper minimal).
๐ License
MIT. See LICENSE.
๐งพ Changelog
See CHANGELOG.md for notable changes.
๐ค Contributing
Issues and pull requests are welcome. Please include a clear description and if possible a test snippet to reproduce or validate the change.
๐งช Example Script
Run the included example after install:
๐งช Tests
Install dev dependencies and run PHPUnit:
๐ Continuous Integration
GitHub Actions workflow runs the test suite on PHP 7.4โ8.3. See .github/workflows/ci.yml.
Author
Luis Cajigas
Enjoy and stay secure!