Jump to content

mcrypt


Recommended Posts

Another extension that is not going as planned!!!

I have c:/php in my system path so I have placed the libmcrypt.dll in c:/php

I have uncommented the extension=php_mcrypt.dll

phpinfo says mcrypt is enabled BUT when I try to use it using the following code
[code] $str = "piughisdauhf pukbn;jbpiusxmdouihc ;noh ;[oc jdfhous ;jndf ;jhoucxh' hi";
echo $str;
srand((double) microtime() * 1000000);
$iv_size = mcrypt_get_iv_size(MCRYPT_SAFER128, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);

$crypt = mcrypt_encrypt (
MCRYPT_SAFER128 ,
'lebataclan' ,
$str ,
MCRYPT_MODE_ECB ,
$iv
);
echo $crypt;
[/code]

I get the following errors..

piughisdauhf pukbn;jbpiusxmdouihc ;noh ;[oc jdfhous ;jndf ;jhoucxh' hi

Warning: mcrypt_get_iv_size(): Module initialization failed in C:\Program Files\Apache Group\Apache2\htdocs\ngc\admin\shop_ordermanager.php on line 151

Warning: mcrypt_create_iv(): Can not create an IV with size 0 or smaller in C:\Program Files\Apache Group\Apache2\htdocs\ngc\admin\shop_ordermanager.php on line 152

Warning: mcrypt_encrypt(): Module initialization failed in C:\Program Files\Apache Group\Apache2\htdocs\ngc\admin\shop_ordermanager.php on line 160

What am I missing?

Thanks in advance
Link to comment
https://forums.phpfreaks.com/topic/26436-mcrypt/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.