Welcome Guest, Not a member yet? Register   Sign In
Encrypt is not working. Why?
#1

[eluser]indapublic[/eluser]
Code:

Code:
$msg = 'My secret message';
$key = 'super-secret-key';

$this->load->library('encrypt');

$encrypted_string = $this->encrypt->encode($msg, $key);

echo "<br>encrypted_string: ";
echo $encrypted_string;

$plaintext_string = $this->encrypt->decode($encrypted_string, $key);

echo "<br>plaintext_string: ";
echo $plaintext_string;

Output:

Quote:encrypted_string: z6av2ITojqUzAgrPNlcaqqC4Evq30Z4Y6GZjfQDjHvgh+fe7e1ybLolTPQzmlXxnapVs7EnN5I1xPv8YT6h6iw==
plaintext_string:

phpinfo() output:

Quote:mcrypt

mcrypt support enabled
mcrypt_filter support enabled
Version 2.5.8
Api No 20021217
Supported ciphers cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes cbc cfb ctr ecb ncfb nofb ofb stream

Directive Local Value Master Value
mcrypt.algorithms_dir no value no value
mcrypt.modes_dir no value no value
#2

[eluser]predat0r[/eluser]
I copy/pasted your code into my dev environment , and it's perfectly working. CI v2.1.3
Try it on a new, clean CI installation.




Theme © iAndrew 2016 - Forum software by © MyBB