Okay, this is just the bare bones process. If you want a full example, then the preceding recipe is for you. This recipe is for people who already have a create-user process, but wish to integrate some password protection into an existing process.
If you don't need the preceding recipe and only require the bare bones of hashing/comparing; please refer to the following steps:
To generate a hash, perform the following steps:
Generate a hash with a key in
$config['encryption_key']
as follows:// Call Encrypt library $this->load->library('encrypt'); $hash = $this->encrypt->sha1($text_to_be_hashed);
Generate a hash with a key other than that in
$config['encryption_key']
as follows:// Call Encrypt library $this->load->library('encrypt'); $key = "This-is-the-key"; $hash = $this->encrypt->sha1($text_to_be_hashed, $key);