Help with mcrypt needed...

From: Date: Tue, 14 Nov 2000 17:47:01 +0000
Subject: Help with mcrypt needed...
Groups: php.windows 
Request: Send a blank email to php-windows+get-3841@lists.php.net to get a copy of this message
I am new to php and I want to use the mcrypt functions. I am trying to implement the example from http://www.php.net/manual/ref.mcrypt.php and I have followed the instructions to download libmcrypt 2.4.x. I obtained the windows version from http://mcrypt.hellug.gr/lib/win32/. I am unable to add this dll as an extension in the ini file and I get a warning stating that the library is invalid and may not be a php library when I use the dl() function. Can anyone tell me what I am doing wrong? Thanks in advance! David I will include the code and output below in case that helps. I have added the mhash module and called one of its functions just to verify that I can add modules properly through the ini file and access its functions. code snippet: <?php echo "Example of using mhash.<p>"; $realkey=mhash(HASH,KEY); echo "\$realkey: $realkey<p><p>"; dl("libmcrypt.dll"); echo "Example of mcrypt Triple DES in ECB mode.<p>"; $key = "this is a very secret key"; $input = "Let us meet at 9 o'clock at the secret place."; $td = mcrypt_module_open (MCRYPT_TripleDES, "", MCRYPT_MODE_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_end ($td); phpinfo(); ?> output: Example of using mhash. $realkey: ¿å9¾ Warning: Invalid library (maybe not a PHP library) 'libmcrypt.dll' in c:\web_development\dmccandless\example.php on line 19 Example of mcrypt Triple DES in ECB mode. Fatal error: Call to undefined function: mcrypt_module_open() in c:\web_development\dmccandless\example.php on line 24

« previous php.windows (#3841) next »