The perfect solution to storage and handle with passwords! The Password-Igniter Library is a simple bcrypt hashing library for CodeIgniter that can be used if your are going to storage user's password! The Library is an adaption of PHPPass for use as a CodeIgniter library.
- Generates unique passwords
- Makes your password storage more secure
- PHP version 5.6 or newer is recommended.
- CodeIgniter version 2.2.1+
To use the Password-Igniter Library you must copy the file application/libraries/Password.php
to your own application/libraries/
folder.
That's all! Have fun!
Below are some examples of what the Assets-Igniter does!
Your can load the Password-Igniter as you load any other library:
$this->load->library('password');
Hashing passwords is easy! You'll pass the password string to the following function:
$str = '1234'; // Please DO NOT use this as your password! Never!
$password = $this->password->hash($str);
Important: The function is supposed to return the encrypted password. But if you receive only the character *
know that an error occurred.
The next function will check the password by comparing the input password with the stored hash. So you are going to need both to check the password.
Since the function will return true
or false
depending on success, you can use an if
clause as the following example:
$str = '1234'; // Please DO NOT use this as your password! Never!
if ($this->password->check($str, $stored_hash))
{
// Password matches stored hash
}
else
{
// Password does not match stored hash
}
This package was created by Gustavo Martins, but your help is welcome! Things you are welcome to do:
- Report any bug you may encounter
- Suggest a feature for the project
For more information about contributing to the project please, read the Contributing Requirements.
Currently, the Password-Igniter Library is in the version 1.0.1. See the full Changelog for more details.