Welcome Guest, Not a member yet? Register   Sign In
CI 1.7. Encrypt class
#1

[eluser]Unknown[/eluser]
I have problem with Encrypt class

i try to encode string, with cipher BLOWFISH

my code:
Code:
$this->load->library("encrypt");
$this->encrypt->set_cipher('MCRYPT_BLOWFISH');
echo "Secret : ".$this->encrypt->encode("secret");

my result:
Code:
A PHP Error was encountered
Severity: Warning
Message: mcrypt_get_iv_size() [function.mcrypt-get-iv-size]: Module initialization failed
Filename: libraries/Encrypt.php
Line Number: 256

A PHP Error was encountered
Severity: Warning
Message: mcrypt_create_iv() [function.mcrypt-create-iv]: Can not create an IV with a size of less then 1 or greater then 2147483647
Filename: libraries/Encrypt.php
Line Number: 257

A PHP Error was encountered
Severity: Warning
Message: mcrypt_encrypt() [function.mcrypt-encrypt]: Module initialization failed
Filename: libraries/Encrypt.php
Line Number: 258

Tested mcrypt
Code:
echo ( ! function_exists('mcrypt_encrypt')) ? 'Nope' : 'Yup';
it works.

Tested crypt
Code:
echo crypt("secret", 'BLOWFISH');
it works to.
#2

[eluser]Pascal Kriete[/eluser]
The available mcrypt cyphers are constants:
Code:
$this->encrypt->set_cipher(MCRYPT_BLOWFISH);
#3

[eluser]Unknown[/eluser]
works! Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB