Codeigniter Encryption Key Codeigniter Encryption Key codeigniter codeigniter

Codeigniter Encryption Key


According to this documentation,http://codeigniter.com/nightly_user_guide/libraries/encryption.html

If you didn't supply any key parameter for $this->encrypt->encode() function, it automatically use config encryption key.

$this->encrypt->encode($msg);


You don't. CI already does that, as you can read on the manual

If you want to pass a custom key, different from that one used in the config file, you need to specify it first:

$msg = 'Message';$key = 'bjA{<ATCs1w5?,8N(bJv';$encrypted_string = $this->encrypt->encode($msg, $key);

But that works only locally, otherwise you just use

$this->encrypt->encode($msg)

and CI applies the default one.

As with decoding it goes the same way, you don't specify the key if you use the default key, else pass your custom one as second parameter of $this->encrypt->decode()