https://github.com/benjaminmedia/phpass
https://github.com/benjaminmedia/phpass
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/benjaminmedia/phpass
- Owner: BenjaminMedia
- Created: 2021-09-28T11:59:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-28T13:40:31.000Z (over 4 years ago)
- Last Synced: 2025-03-26T14:54:35.724Z (about 1 year ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Openwall Phpass, modernized
===========================
[](http://travis-ci.org/hautelook/phpass)
[](http://hhvm.h4cc.de/package/hautelook/phpass)
This is Openwall's [Phpass](http://openwall.com/phpass/), based on the 0.3 release, but modernized slightly:
- Namespaced
- Composer support (Autoloading)
- PHP 5 style
- Unit Tested
The changes are minimal and only stylistic. The source code is in the public domain. We claim no ownership, but needed it for one of our projects, and wanted to make it available to other people as well.
## Installation ##
Add this requirement to your `composer.json` file and run `composer.phar install`:
{
"require": {
"bonnier/phpass": "dev-master"
}
}
## Usage ##
The following example shows how to hash a password (to then store the hash in the database), and how to check whether a provided password is correct (hashes to the same value):
``` php
HashPassword('secret');
var_dump($password);
$passwordMatch = $passwordHasher->CheckPassword('secret', "$2a$08$0RK6Yw6j9kSIXrrEOc3dwuDPQuT78HgR0S3/ghOFDEpOGpOkARoSu");
var_dump($passwordMatch);