waldirbertazzijr / codeigniter-bcrypt

Simple bcrypt high-security hashing library for codeigniter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Codeigniter bcrypt Library

Simple bcrypt hashing library helper for Codeigniter.

Crypting

This function will help you crypt any string.

$input_password = $this->input->post('input-password');
$hashed_password = $this->bcrypt->hash($password);

Decrypting (comparing)

After you got the crypted string (method above), you can't reverse it, but can compare (and validate) the source string from the hashed one. The compare method receives 2 strings, the original and the hashed one. Returns true if the second was generated by the first one.

$user_password = $this->input->post('input-password');
$is_really_the_password = $this->CI->bcrypt->compare($password_string, $this->user_data->password);

About

Simple bcrypt high-security hashing library for codeigniter.


Languages

Language:PHP 100.0%