Welcome Guest, Not a member yet? Register   Sign In
encryption_key in CI 3.x
#1

I know in CI 3.x the instructions are:

Code:
$this->load->library('encryption');
$key = $this->encryption->create_key(16);
// Get a hex-encoded representation of the key:
$key = bin2hex($this->encryption->create_key(16));

// Put the same value in your config with hex2bin(),
// so that it is still passed as binary to the library:
$config['encryption_key'] = hex2bin(<your hex-encoded key>);


So the $config setting goes in config.php. But where do the top 3 lines go? Just in any controller? In my base controller? Somewhere else? Clearly you can't use $this outside of an object.
Reply


Messages In This Thread
encryption_key in CI 3.x - by bjacobs - 08-18-2017, 10:50 AM
RE: encryption_key in CI 3.x - by skunkbad - 08-18-2017, 11:35 PM
RE: encryption_key in CI 3.x - by Narf - 08-21-2017, 12:46 AM
RE: encryption_key in CI 3.x - by bjacobs - 08-21-2017, 07:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB