Jump to content


Photo

mcrypt doesn't load


  • Please log in to reply
2 replies to this topic

#1 raptor

raptor

    Newbie

  • Member
  • Pip
  • 6 posts
  • Main OS: Windows XP

Posted 13 February 2008 - 09:27 AM

Cannot get mcrypt to load in appollo. I have :

1. download libmcrypt.dll and place it in \usr\local\php\extensions (also in windows\system32 and \usr\local\php)

2. added "extension=libmcrypt.dll" to php.ini

3. reboot

help! or other encrypt-decrypt options.

#2 Ric

Ric

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 1,535 posts
  • Gender:Male
  • Location:Cambridge,UK
  • Interests:Electronics
    Internet in general
    Open source projects
  • SourceForge IDmpgcan
  • Wiki ID: Ric
  • Main OS: Windows XP

Posted 13 February 2008 - 12:37 PM

There are a few things wrong! Some are now of your making this is no reflection on you because it extends from a missing extension. You understand what I mean after following these steps to get it working:

1) Reverse what you have done:
a) Delete libmcrypt.dll from system32 folder.
B) libmcrypt.dll is in the correct folder *\Uniform Server\udrive\usr\local\php :)
d) Open php.ini and delete the line you added "extension=libmcrypt.dll"
2) Locate the line ;extension=php_mcrypt.dll and un-comment to give extension=php_mcrypt.dll
3) Its this file (php_mcrypt.dll) you are missing and may have lead to the confusion. To save you legwork I have attached the file, download (double click to extract file) and save it to folder *\Uniform Server\udrive\usr\local\php\extensions
4) Restart the servers and it should work! :)

I have never used this function though I would give it a bash and run the examples from http://uk2.php.net/mcrypt :)

This code:

<?php
$key = "this is a secret key";
$input = "Let us meet at 9 o'clock at the secret place.";
$encrypted_data = mcrypt_ecb (MCRYPT_3DES, $key, $input, MCRYPT_ENCRYPT);
?>

Promptly produced this error:
Warning: mcrypt_ecb() [function.mcrypt-ecb]: Attempt to use an empty IV, which is NOT recommend :)

I do not have an issue with that, show the modules work. :)

Interestingly this works:

<?php
$key = "this is a secret key";
$input = "Let us meet at 9 o'clock at the secret place.";

$td = mcrypt_module_open('tripledes', '', 'ecb', '');
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
mcrypt_generic_init($td, $key, $iv);
$encrypted_data = mcrypt_generic($td, $input);
mcrypt_generic_deinit($td);
mcrypt_module_close($td);

echo $encrypted_data;
?>

Makes for an interesting display :lol: (Note IV in this example has been defined).

Have fun

All the best
Ric :)

Attached Files



#3 raptor

raptor

    Newbie

  • Member
  • Pip
  • 6 posts
  • Main OS: Windows XP

Posted 13 February 2008 - 03:34 PM

Ric,

Thanks, thanks, thanks!!! I did a clean install on another computer and all is fine. I spent almost a full day chasing over the 'net looking for mcrypt-windows solutions. One was to put in windows/system32 folder; another to use mcrypt.exe. Where did you find php_mcrypt.dll?

Thanks again for your prompt help. This is my first request for help and I have been using uniformserver for about 3 years - and never needed help as it works so flawlessly- and it is great!

To help support uniform server I just made a contribution via paypal and I urge all satisfied uses to do the same in support of such a great effort.

-raptor



There are a few things wrong! Some are now of your making this is no reflection on you because it extends from a missing extension. You understand what I mean after following these steps to get it working:

1) Reverse what you have done:
a) Delete libmcrypt.dll from system32 folder.
B) libmcrypt.dll is in the correct folder *\Uniform Server\udrive\usr\local\php :)
d) Open php.ini and delete the line you added "extension=libmcrypt.dll"
2) Locate the line ;extension=php_mcrypt.dll and un-comment to give extension=php_mcrypt.dll
3) Its this file (php_mcrypt.dll) you are missing and may have lead to the confusion. To save you legwork I have attached the file, download (double click to extract file) and save it to folder *\Uniform Server\udrive\usr\local\php\extensions
4) Restart the servers and it should work! :)

I have never used this function though I would give it a bash and run the examples from http://uk2.php.net/mcrypt :)

This code:

<?php
$key = "this is a secret key";
$input = "Let us meet at 9 o'clock at the secret place.";
$encrypted_data = mcrypt_ecb (MCRYPT_3DES, $key, $input, MCRYPT_ENCRYPT);
?>

Promptly produced this error:
Warning: mcrypt_ecb() [function.mcrypt-ecb]: Attempt to use an empty IV, which is NOT recommend :)

I do not have an issue with that, show the modules work. :)


Interestingly this works:

<?php
$key = "this is a secret key";
$input = "Let us meet at 9 o'clock at the secret place.";

$td = mcrypt_module_open('tripledes', '', 'ecb', '');
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
mcrypt_generic_init($td, $key, $iv);
$encrypted_data = mcrypt_generic($td, $input);
mcrypt_generic_deinit($td);
mcrypt_module_close($td);

echo $encrypted_data;
?>

Makes for an interesting display :lol: (Note IV in this example has been defined).

Have fun

All the best
Ric :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users