CodeIgniter Forums

Full Version: Encrypt Library and get_key
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
In looking at the get_key function within the Encrypt.php Library it looks it should be returning the md5 in 32-character hexadecimal format. However when echoing out the key it appears to be in the raw binary format.

What causes this behavior and how can I change it?

Code:
function get_key($key = '')
{
  if ($key == '')
  {
   if ($this->encryption_key != '')
   {
    return $this->encryption_key;
   }

   $CI =& get_instance();
   $key = $CI->config->item('encryption_key');

   if ($key == FALSE)
   {
    show_error('In order to use the encryption class requires that you set an encryption key in your config file.');
   }
  }

  return md5($key);
}