Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dwightwatson/codeigniter-bcrypt
Adaption of PHPPass for use as a CodeIgniter Bcrypt library.
https://github.com/dwightwatson/codeigniter-bcrypt
Last synced: 3 days ago
JSON representation
Adaption of PHPPass for use as a CodeIgniter Bcrypt library.
- Host: GitHub
- URL: https://github.com/dwightwatson/codeigniter-bcrypt
- Owner: dwightwatson
- Archived: true
- Created: 2012-07-30T04:19:11.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-03-11T01:47:36.000Z (over 7 years ago)
- Last Synced: 2024-04-14T06:06:58.145Z (7 months ago)
- Language: PHP
- Size: 355 KB
- Stars: 42
- Watchers: 7
- Forks: 53
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-codeigniter - Bcrypt CodeIgniter - Adaption of PHPPass for use as a CodeIgniter Bcrypt library. (Libraries)
README
# codeigniter-bcrypt
## DEPRECATION WARNING
This library is not maintained, and it is suggested that you don't use it. It was simply a CodeIgniter wrapper around the PHPPass library. Please look into using [PHP's native password hasing functions instead](https://secure.php.net/manual/en/function.password-hash.php).
## Bcrypt (PHPPass) for CodeIgniter
Adaption of PHPPass (0.3) for use as a CodeIgniter Bcrypt library.
Allowed for the use of a separate config file, adjusted for some CodeIgniter configurability, added the scope of functions, changed hashing and checking functions to meet CodeIgniter standards for function names.
## Installation
* Place ``Bcrypt.php`` in your ``application/libraries`` folder.
* Place ``bcrypt.php`` in your ``application/config`` folder.
* Adjust options in the config file as neccessary.## Usage
First, load the Bcrypt library or autoload it in ``config/autoload.php``.$this->load->library('bcrypt');
### Hashing
To hash a password, simply pass the string to ``hash_password()``.$password = 'hunter2';
$hash = $this->bcrypt->hash_password($password);The function will return the hashed password or ``*`` on error.
### Checking
To check a hash password, simply pass the string and stored password to ``check_password()``.$password = 'hunter2';
if ($this->bcrypt->check_password($password, $stored_hash))
{
// Password does match stored password.
}
else
{
// Password does not match stored password.
}
The function will return ``TRUE`` or ``FALSE`` dependant on success.