[PHP] MCrypt not decrypting simple text

2008-03-20 Thread Dan
I'm using MCrypt and I have two very simple functions.  All I'm doing is 
giving the function some text and a password, it encrypts the text and saves 
it as a text file on the server.  Then I at some later time run another php 
file which decrypts using the decrypt function given the text and the SAME 
password as the first time and all I get is garbage.  What am I doing wrong? 
What do I need to change so that I can get this to work the way I described?


function aes_128_encrypt($text,$password) {

  $size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
   $iv = mcrypt_create_iv($size, MCRYPT_DEV_RANDOM);

   $text .= chr(3).chr(3).chr(3);

   return bin2hex(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $password, $text, 
MCRYPT_MODE_ECB, $iv));


} // End of function

and

function aes_128_decrypt($encrypted_text,$password) {

   $size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
   $iv = mcrypt_create_iv($size, MCRYPT_DEV_RANDOM);

   return mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $password, pack(H*, 
$encrypted_text), MCRYPT_MODE_ECB, $iv);


} // End of function


- Dan 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] MCrypt resource limits?

2006-08-23 Thread Eric Butera

Hi list,

Yesterday I noticed one of the sites I had created was running really slow.
Yet all the other sites on our webserver were running great.  I had our
network admin look at the cpu, ram usage, etc of the webserver and
everything looked fine.  Finally I just recommended we stick Xdebug on there
to find out what the exact problem was.  It boiled down to my encryption
wrapper object.  I guess there were too many MCrypt resources open at once.
I'm not really sure of the real problem, but when I switched around some
code to avoid unnecessarily loading initializing the resource, the site was
zippy again.

As I was developing locally everything was fine because it was just me
hitting the site.  When I pushed it to the server though there was quite a
bit of traffic to it.  So my question is, are there limits in PHP to how
many resources can be opened?  What about limits to how many MCrypt
resources you can have open?  This specific instance was a stupid mistake on
my part, but I just want to know for future reference.

Thanks!


[PHP] mcrypt

2006-01-18 Thread Duffy, Scott E
Is it possible to set the key length for mcrypt with the cipher
Blowfish? Specifically to lets say 128 bits? 
mcrypt_get_key_size
returns int but is it bytes bits?

Maybe I could do with openssl?

Ideas and thoughts very welcome.

Thanks,


Scott


Re: [PHP] mcrypt

2006-01-18 Thread Richard Lynch
On Tue, January 17, 2006 7:05 pm, [EMAIL PROTECTED] wrote:
 Since I'm running php under safe mode and the gpglib extension is not
 installed in php at my isp gpg seems to be unavalible for me. Are
 there anything else I can use with public/private keys that is as
 safe/solid/hard to crack as gpg? The mcrypt extension is installed if
 that helps, or are all those crypts using the same key for encryption
 and decryption? (I've read a couple pages about the crypt algorithms
 at wikipedia, but it didn't really help me)

If you dig really deep for my name (probably not current email tho)
and GPG in the PHP archvies, you'll find a long-running thread about
using http://php.net/exec to run gpg

WARNING:
This exposes your data to 'ps' and 'top' and that ilk...

Better to use http://php.net/popen once you've hammered out the fun
parts...

All the different crypts are using different algorithms -- that's
rather the whole point of them all having different names and stuff.
:-)

I'm not sure any of them are similar enough to GPG to be useful, but I
*think* you could use some of them to generate key-pairs not unlike
GPG and then use them in a similar way to GPG...

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt

2006-01-17 Thread emil

Hello,

Since I'm running php under safe mode and the gpglib extension is not installed 
in php at my isp gpg seems to be unavalible for me. Are there anything else I 
can use with public/private keys that is as safe/solid/hard to crack as gpg? 
The mcrypt extension is installed if that helps, or are all those crypts using 
the same key for encryption and decryption? (I've read a couple pages about the 
crypt algorithms at wikipedia, but it didn't really help me)

Regards Emil

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt

2006-01-13 Thread Duffy, Scott E
Trying to encrypt then decrypt text with php using mcrypt. The encrypt seems to 
work but when I decrypt it with a different script I get most of it but some 
garbage. Using blowfish. So to test.
Encrypt.php
   $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
   $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
   $key = This is a very secret key;
   $text = Meet me at 11 o'clock behind the monument.;
   //echo strlen($text) . \n;

  $crypttext = mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $text, MCRYPT_MODE_ECB, 
$iv);
   echo $crypttext. \n;

decrypt.php

$server = $_SERVER['SERVER_NAME'];
$url = 'http://'.$server.'/encrypt.php';
$fh = fopen($url,'r') or die (cant open: $php_errormsg);
$new_string=; 
while (! feof($fh))
{
$new_string = $new_string.rtrim(fgets($fh,4096));
}

$enc=$newstring;
   $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
$enc=$_POST['text'];
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$key = This is a very secret key;
$text = Meet me at 11 o'clock behind the monument.;
//echo strlen($text) . br;

$crypttext = mcrypt_decrypt(MCRYPT_BLOWFISH, $key, $enc, MCRYPT_MODE_ECB, $iv);
echo $crypttextbr;


I get from decrypt
Meet me at 11 o'clock behind the monumen3ýÚ·nÃtbr
Is it doing some padding or something? When I encrypt/decrypt same script it 
works fine.
Maybe something to do with these?
   $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
   $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);



Thanks,

Scott Duffy


Re: [PHP] mcrypt

2006-01-13 Thread Jason Gerfen

Duffy, Scott E wrote:


Trying to encrypt then decrypt text with php using mcrypt. The encrypt seems to 
work but when I decrypt it with a different script I get most of it but some 
garbage. Using blowfish. So to test.
Encrypt.php
  $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
  $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
  $key = This is a very secret key;
  $text = Meet me at 11 o'clock behind the monument.;
  //echo strlen($text) . \n;

 $crypttext = mcrypt_encrypt(MCRYPT_BLOWFISH, $key, $text, MCRYPT_MODE_ECB, 
$iv);
  echo $crypttext. \n;

decrypt.php

$server = $_SERVER['SERVER_NAME'];
$url = 'http://'.$server.'/encrypt.php';
$fh = fopen($url,'r') or die (cant open: $php_errormsg);
$new_string=;   
while (! feof($fh))
{
$new_string = $new_string.rtrim(fgets($fh,4096));
}

$enc=$newstring;
  $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
$enc=$_POST['text'];
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$key = This is a very secret key;
$text = Meet me at 11 o'clock behind the monument.;
//echo strlen($text) . br;

$crypttext = mcrypt_decrypt(MCRYPT_BLOWFISH, $key, $enc, MCRYPT_MODE_ECB, $iv);
echo $crypttextbr;


I get from decrypt
Meet me at 11 o'clock behind the monumen3ýÚ·nÃtbr
Is it doing some padding or something? When I encrypt/decrypt same script it 
works fine.
Maybe something to do with these?
  $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
  $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);



Thanks,

Scott Duffy

 


Look at trim().  And your right it does have to do with using ECB.

--
Jason Gerfen

The charge that he had insulted Turkey's armed forces was dropped, but he still faces  the 
charge that he insulted Turkishness, lawyers said.
~ BBC News Article

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mcrypt 3DES encrypt/decrypt Help

2005-11-07 Thread Andrew Brampton
I've never used the mcrypt functions, but from a quick read of the 
documentation I think you are using a 384 bit key!... Each letter in your 
key string is a 8bit ASCII character, and since you have 48 chars, you have 
8*48 bits.


The documentation says:
 Key is the key with which the data will be encrypted. If it's smaller that 
the required keysize, it is padded with '\0'. It is better not to use ASCII 
strings for keys. It is recommended to use the mhash functions to create a 
key from a string. 

and gives the example:
$key = This is a very secret key;

In that example the key is 25 bytes long, therefore 200 bits long, and then 
padded with \0s.


If you want your key to represent the hex of the key then I believe you must 
use pack(), or one of the user comments on the bin2hex() help page (namely 
the hexbin() function).



Hope this helps
Andrew

- Original Message - 
From: [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Monday, November 07, 2005 4:56 AM
Subject: [PHP] Mcrypt 3DES encrypt/decrypt Help


Hi all:
I wan't to use php_mcrpyt to encrypt data,but have a problem in it !

Hint:
Warning: mcrypt_encrypt(): Size of key is too large for this algorithm

Algorithm : 3DES
Key: 48bit

?php
// Designate string to be encrypted
$string =3D Applied Cryptography, by Bruce Schneier, is a wonderful
cryptography reference.;

// Encryption/decryption key
$key =3D C770634F437346D7FC8FA22F9287849E741A33438EEDEAAD;

// Encryption Algorithm
$cipher_alg =3D MCRYPT_3DES;

// Create the initialization vector for added security.
$iv =3D mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg,
MCRYPT_MODE_ECB), MCRYPT_RAND);

// Output original string
print Original string: $string ;

// Encrypt $string
$encrypted_string =3D mcrypt_encrypt($cipher_alg, $key, $string,
MCRYPT_MODE_CBC, $iv);

// Convert to hexadecimal and output to browser
print Encrypted string: .bin2hex($encrypted_string). ;
$decrypted_string =3D mcrypt_decrypt($cipher_alg, $key,
$encrypted_string, MCRYPT_MODE_CBC, $iv);

print Decrypted string: $decrypted_string;
?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Mcrypt 3DES encrypt/decrypt Help

2005-11-06 Thread yangguang1981
Hi all:
I wan't to use php_mcrpyt to encrypt data,but have a problem in it !

Hint:
Warning: mcrypt_encrypt(): Size of key is too large for this algorithm

Algorithm : 3DES
Key: 48bit

?php
// Designate string to be encrypted
$string =3D Applied Cryptography, by Bruce Schneier, is a wonderful
cryptography reference.;

// Encryption/decryption key
$key =3D C770634F437346D7FC8FA22F9287849E741A33438EEDEAAD;

// Encryption Algorithm
$cipher_alg =3D MCRYPT_3DES;

// Create the initialization vector for added security.
$iv =3D mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg,
MCRYPT_MODE_ECB), MCRYPT_RAND);

// Output original string
print Original string: $string ;

// Encrypt $string
$encrypted_string =3D mcrypt_encrypt($cipher_alg, $key, $string,
MCRYPT_MODE_CBC, $iv);

// Convert to hexadecimal and output to browser
print Encrypted string: .bin2hex($encrypted_string). ;
$decrypted_string =3D mcrypt_decrypt($cipher_alg, $key,
$encrypted_string, MCRYPT_MODE_CBC, $iv);

print Decrypted string: $decrypted_string;
?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt problem under Windows

2005-08-18 Thread Konrad Billewicz
Hello,

I have a problem with mcrypt library. I'm using Apache 2.0.54 under Windows and 
PHP 4.3.3.

I tried to run an example from PHP site [1] but it is not working - the 
decrypting is doing nothing. I searched the web and found only that I need to 
download newer version of libmcrypt.dll (but I'm unable to find version 2.5.6 
or 
newer, only older ie. from [2] or sources). Some other person in this groups 
archive suggested to use mycrypt.dll instead of default php extension but I 
didn't understant his idea.

I would be very grateful for the solution. As simple as possible.

Best regards,
Konrad Billewicz

Links:
[1] http://www.php.net/manual/en/function.mdecrypt-generic.php
[2] http://ftp.emini.dk/pub/php/win32/mcrypt/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt public and private key

2005-02-03 Thread Daniel Bowett
Hi,
I have been reading up on the mcrypt function. Is it possible to use it 
with a public and private key pair or just with a single key?

Cheers.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mcrypt public and private key

2005-02-03 Thread Marek Kilimajer
Daniel Bowett wrote:
Hi,
I have been reading up on the mcrypt function. Is it possible to use it 
with a public and private key pair or just with a single key?

Cheers.
mcrypt supports only single key
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] mcrypt: generic_init failed

2004-11-23 Thread Adelaide Yip
Hi,

Our website uses mcrypt functions to encrypt and decrypt passwords
stored in the PostgreSQL database.  The website encrypted/decrypted
passwords flawlessly under PHP 4.0.4, however, we recently upgraded the
server that the website is stored on to PHP 4.2.3.

Since then, each time a password is encrypted/decrypted using any of the
mcrypt-functions, the following error displays even though the code was
untouched:

Fatal error: generic_init failed in
/home/httpd/html/domainsunderdevelop/include/class.databaseconnection.php on 
line 498

Line 498 on class.databaseconnection.php is:
$NewString = mcrypt_cbc( $this-CIPHER, $this-KEY, $RawString, $Mode,
$iv );

We installed libmcrypt 2.4.9 after upgrading PHP to 4.2.3.

If you have any suggestions or ideas, please let me know.


Thanks in advance,
Adelaide

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt: generic_init failed

2004-11-23 Thread Adelaide Yip
Hi,

I forgot to mention that the website is running on RedHat kernel-2.4.20.

-- Adelaide

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP - MCRYPT - CBC - IDEA

2004-11-05 Thread Frantzcy Paisible
Hi all,

   I'm looking for some information, rearging mcrypt.
Now, I've been through the normal channels, I've been going in in cercles.


I need to recreate this perl script in php :

sub cryptage
{
  use Crypt::CBC; 
  $key = SuperFreak; 
  my $action = shift; 
  my $string = shift; 

  my $c = new Crypt::CBC($key,IDEA); 
  if ($action == 1) { #- crypt 
return $c-encrypt_hex($string); 
  } else { #- decrypt 
return $c-decrypt_hex($string   ); 
}


As you can notice it uses CBC, and IDEA.

MCRYPT_IDEA (non-free) is all I get from the net, where can I purchase it ?
Or better yet, how can I recreate this function in PHP ?

even a simple Look this way would help.

Thanx

Frantzcy


-- 

Sleep, sometime in MAY... if lucky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP - MCRYPT - CBC - IDEA

2004-11-05 Thread Ben Ramsey
Frantzcy Paisible wrote:
   I'm looking for some information, rearging mcrypt.
Now, I've been through the normal channels, I've been going in in cercles.

even a simple Look this way would help.
Look this way: http://www.php.net/mcrypt
:-)
--
Ben Ramsey
Zend Certified Engineer
http://benramsey.com
---
Atlanta PHP - http://www.atlphp.org/
The Southeast's premier PHP community.
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: PHP - MCRYPT - CBC - IDEA

2004-11-05 Thread Frantzcy Paisible

Thanx Ben,

  But I've been thru this one, in and out, and it's exactly one of those that say 
MCRYPT_IDEA (non-free)  but not more.

Have you used mcrypt ? with cbc and IDEA ?

Frantzcy


On Fri, 05 Nov 2004 13:30:04 -0500,Ben Ramsey [EMAIL PROTECTED]
wrote:

 Frantzcy Paisible wrote:
 I'm looking for some information, rearging mcrypt.
  Now, I've been through the normal channels, I've been going in in
  cercles.
 
  even a simple Look this way would help.
 
 Look this way: http://www.php.net/mcrypt
 :-)
 
 -- 
 Ben Ramsey
 Zend Certified Engineer
 http://benramsey.com
 
 ---
 Atlanta PHP - http://www.atlphp.org/
 The Southeast's premier PHP community.
 ---
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 


-- 

Sleep, sometime in MAY... if lucky

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP - MCRYPT - CBC - IDEA

2004-11-05 Thread Greg Donald
On Fri, 5 Nov 2004 13:10:43 -0500, Frantzcy Paisible
[EMAIL PROTECTED] wrote:
 I need to recreate this perl script in php :

I'm not sure if you realize it, but you can call the Perl script from
PHP using system().


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP - MCRYPT - CBC - IDEA

2004-11-05 Thread Ben Ramsey
Frantzcy Paisible wrote:
  But I've been thru this one, in and out, and it's exactly one of those that say 
MCRYPT_IDEA (non-free)  but not more.
Have you used mcrypt ? with cbc and IDEA ?
Sorry about that. I must have read your message wrong. I have used 
mcrypt, but not with IDEA or cbc. Are you locked into that particular 
cipher? Can you not use a different one? (I suppose you can't since all 
your existing passwords would use the old cipher.)

You could continue to use your old Perl script by using exec() or 
passthru() from PHP to call it, but, then again, your code could end up 
on thephpwtf.com, opening you to scorn and ridicule from the few who 
deem themselves worthy enough to criticize everyone's code.

Have you checked out libmcrypt, installed it, and tried it? It looks 
like they've implemented the IDEA algorithm in libmcrypt. I could be 
wrong, since I've never used it. http://mcrypt.sourceforge.net/

--
Ben Ramsey
Zend Certified Engineer
http://benramsey.com
---
Atlanta PHP - http://www.atlphp.org/
The Southeast's premier PHP community.
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] mcrypt install question

2004-10-07 Thread Ed Lazor
PHP is installed from rpm's.  Is it possible to install mcrypt / libmcrypt
from rpm and enable it in PHP without having to recompile?

 

Thanks,

 

Ed

 



Re: [PHP] mcrypt install question

2004-10-07 Thread Greg Donald
On Thu, 7 Oct 2004 08:37:19 -0700, Ed Lazor [EMAIL PROTECTED] wrote:
 PHP is installed from rpm's.  Is it possible to install mcrypt / libmcrypt
 from rpm and enable it in PHP without having to recompile?

I was able to gain this functionality with Suse 9.1.  I don't know
about other distros however.

 rpm -qa|grep mcrypt
libmcrypt-2.5.7-121
php4-mcrypt-4.3.4-26


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mcrypt install question

2004-10-07 Thread Ed Lazor
Did you install it and PHP automatically recognized things or did you have
to enable something in php.ini and restart?  I checked the php.ini file on
the server and there's nothing mycrypt or crypt.



 -Original Message-
 On Thu, 7 Oct 2004 08:37:19 -0700, Ed Lazor [EMAIL PROTECTED] wrote:
  PHP is installed from rpm's.  Is it possible to install mcrypt /
 libmcrypt
  from rpm and enable it in PHP without having to recompile?
 
 I was able to gain this functionality with Suse 9.1.  I don't know
 about other distros however.
 
  rpm -qa|grep mcrypt
 libmcrypt-2.5.7-121
 php4-mcrypt-4.3.4-26

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mcrypt install question

2004-10-07 Thread Greg Donald
On Thu, 7 Oct 2004 09:10:22 -0700, Ed Lazor [EMAIL PROTECTED] wrote:
 Did you install it and PHP automatically recognized things or did you have
 to enable something in php.ini and restart?  I checked the php.ini file on
 the server and there's nothing mycrypt or crypt.

It appears to 'just work' as I have nothing in my php.ini about it either.

My phpinfo() configuration block says --with-mcrypt however.  I'm
guessing if I hadn't added the php4-mcrypt rpm it would have just not
loaded it.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Encryption in PHP - mcrypt and alternatives

2004-07-05 Thread Mike Morton
I have a need for an encryption program that can encrypt/decrypt data.  I
previously had a programmer build me a C program that compiled and runs on
the command line, which I would then call via PHP.

We are experiencing with this however, a 5-7% fail rate on the decryption -
not acceptable for the application.  At this point the programmer is blaming
the mcrypt libraries for the problem - I suspect not, but not being a C
programmer, cannot refute this.

So, the next step was to use Mcrypt Libraries through PHP. They are not
compiled into our PHP version - 4.1.2, and we cannot re-compile PHP.  First
reason is that the server runs Plesk 5, and the original compile was done
off server  (you know - host provider - install via disk image, etc).
Bottom line, PHP cannot be re-compiled with mcrypt.

Finally, I tried dynamically loading he libmcrypt.so library - compiled just
this morning specifically for this application.  No go.  It would not load
from the php.ini file, and when I tried to load it on a page, using the dl()
function - I got the error:

Invalid library (maybe not a PHP library) 'libmcrypt.so'

So at this point I am at a total loss.  I cannot hash the data, I need it to
be decrypted at another point as well.

So, I guess I am asking this:

1.  Is there any reasonably priced C programmer that would like to talk to
me about fixing/re-writing this encryption program.
2.  Have I overlooked anything with the dynamic loading of the mcrypt
libraries.
And
3.  Am I missing another alternative for securely encrypting/decrypting data
in PHP?  Short of re-compiling or such.

Thanks in advance!


--
Cheers

Mike Morton


*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*


Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple.
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt pdflib configuration

2004-05-12 Thread William Holroyd
I've already posted this question in comp.lang.php but no one seemed to have
an answer to it.

So I've got PHP to recognize mcrypt and pdflib in the phpinfo() output, but
trying to use any of the functions fail with ...undefined function
called... There aren't any configurable files with either distro and
neither mention php.ini settings need to be made. Restarting the apache
server does not fix this and no errors are reported while starting.

The most recent stable releases Apache 2.0.49 and PHP 4.3.6 are being used
with mcrypt 2.4 (stable, but 2.6.4 is most recent) and pdflib 5.0.3p1 (most
recent stable release) libraries, running on Windows 2003 Server Enterprise
with all updates applied.

I picked up a copy of Visual Studio .NET Enterprise but am also stumped of
how to compile these functions from source which I would prefer to do at
this point.

Any help on either topic is much appreciated.

-William

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] MCRYPT Help

2004-03-02 Thread Miguel J. Jimnez
Hi, I have the following script that encode data using 3DES, but I 
cannot make a script to DECODE that data because all the tries return me 
thwe wrong string, can anybody tell me the right script to decode the data?

Copied from PHP Manual:

?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 KEY = .$key.br;
   echo INPUT = .$input.br;
   echo ENCRYPTED = .$encrypted_data;
?
--
Miguel J. Jiménez
ISOTROL, S.A. (Área de Internet)
Avda. Innovación nº1, 3ª - 41020 Sevilla (ESPAÑA)
[EMAIL PROTECTED]
TLFNO. 955036800 ext. 111
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] mcrypt don't work.

2004-02-08 Thread francesco
Hi all,
I have problem with mcrypt function.
There is always an error that I don't know how to correct this.
This is my code:

$string = Text string;
$key= My key;
$encrypted = mcrypt_cfb(MCRYPT_RIJNDAEL-256, $key, $string, MCRYPT_ENCRYPT);  
echostringa cifrata= $encrypted;
$key = My key;
$string = mcrypt_cfb(MCRYPT_RIJNDAEL-256, $key, $encrypted, MCRYPT_DECRYPT);  
echostringa decifrata= $string;

And the errore message is

Warning: mcrypt_cfb(): Module initialization failed in 
/web/htdocs/www.automationsoft.biz/home/critto.php on line 55
stringa cifrata= 
Warning: mcrypt_cfb(): Module initialization failed in 
/web/htdocs/www.automationsoft.biz/home/critto.php on line 58
stringa decifrata= 

I see, with phpinfo(), that my server support mcrypt and  RIJNDAEL-256.
I don't know why there is this error message.
All helps are precious.
Thanks in advance 
Francesco
[EMAIL PROTECTED]
(P.S. this is the link for a view in real time of  the problem 
www.automationsoft.biz/critto.php)
 

Re: [PHP] mcrypt don't work.

2004-02-08 Thread Miguel J. Jiménez
Mmm this same problem happen to me also... I use Apache 1.3.29 for Win32 
and PHP v4.3.4 ... I do not know why but mcrypt module failed to 
initialize

[EMAIL PROTECTED] wrote:

Hi all,
I have problem with mcrypt function.
There is always an error that I don't know how to correct this.
This is my code:
$string = Text string;
$key= My key;
$encrypted = mcrypt_cfb(MCRYPT_RIJNDAEL-256, $key, $string, MCRYPT_ENCRYPT);  
echostringa cifrata= $encrypted;
$key = My key;
$string = mcrypt_cfb(MCRYPT_RIJNDAEL-256, $key, $encrypted, MCRYPT_DECRYPT);  
echostringa decifrata= $string;

And the errore message is

Warning: mcrypt_cfb(): Module initialization failed in /web/htdocs/www.automationsoft.biz/home/critto.php on line 55
stringa cifrata= 
Warning: mcrypt_cfb(): Module initialization failed in /web/htdocs/www.automationsoft.biz/home/critto.php on line 58
stringa decifrata= 

I see, with phpinfo(), that my server support mcrypt and  RIJNDAEL-256.
I don't know why there is this error message.
All helps are precious.
Thanks in advance 
Francesco
[EMAIL PROTECTED]
(P.S. this is the link for a view in real time of  the problem www.automationsoft.biz/critto.php)

 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mcrypt don't work.

2004-02-08 Thread Adam Bregenzer
On Sun, 2004-02-08 at 05:18, [EMAIL PROTECTED] wrote:
 Hi all,
 I have problem with mcrypt function.
 There is always an error that I don't know how to correct this.
 This is my code:
 
 $string = Text string;
 $key= My key;
 $encrypted = mcrypt_cfb(MCRYPT_RIJNDAEL-256, $key, $string, MCRYPT_ENCRYPT);  
 echostringa cifrata= $encrypted;
 $key = My key;
 $string = mcrypt_cfb(MCRYPT_RIJNDAEL-256, $key, $encrypted, MCRYPT_DECRYPT);  
 echostringa decifrata= $string;

If you are using mycrypt 2.4.x you need to do something like this:
encrypt:
# initialize the encryption module
$mc_module = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '',
MCRYPT_MODE_ECB, '');
mcrypt_generic_init($mc_module, $encryption_key, $iv);

# encrypt the data
$encrypted_data = mcrypt_generic($mc_module, $data);

# de-initialize the encryption module
mcrypt_generic_deinit($mc_module);
mcrypt_module_close($mc_module);


decrypt:
# initialize the encryption module
$mc_module = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', 
MCRYPT_MODE_ECB, '');
mcrypt_generic_init($mc_module, $encryption_key, $iv);

# decrypt the data
$decrypted_data = mdecrypt_generic($mc_module, $encrypted_data);
# trim any trailing \0, encrypted data is automatically padded to a
32byte boundary with \0
$decrypted_data = rtrim($decrypted_data);

# de-initialize the encryption module
mcrypt_generic_deinit($mc_module);
mcrypt_module_close($mc_module);

Check the documentation[1] for more information on encryption keys and
initialization vectors.

[1] http://www.php.net/mcrypt

-- 
Adam Bregenzer
[EMAIL PROTECTED]
http://adam.bregenzer.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt don't work.

2004-02-03 Thread francesco
Hi all,
i've problem with mcrypt_cfb function.
This is the code:

$string = A simple text string;
$key = My key;
line 55: $encrypted = mcrypt_cfb(MCRYPT_IDEA, $key, $string, MCRYPT_ENCRYPT);  
$key = My key;
line 59: $string = mcrypt_cfb(MCRYPT_IDEA, $key, $encrypted, MCRYPT_DECRYPT);  

I've alway this error message:

Warning: mcrypt_cfb(): Module initialization failed in 
/web/htdocs/www.automationsoft.biz/home/critto.php on line 55
stringa cifrata= 
Warning: mcrypt_cfb(): Module initialization failed in 
/web/htdocs/www.automationsoft.biz/home/critto.php on line 59
stringa decifrata= 

and I don't know where is the problem..
Is the sintax correct?
I see mcrypt function in PHP manual at www.php.net but I don't find the problem.
Can you explain me how use mcrypt function?

All helps are precious.
Thanks in advance.
Frank
[EMAIL PROTECTED]

Re: [PHP] mcrypt don't work.

2004-02-03 Thread Jochem Maas
Francesco,

mcrypt_ functions rely on a PHP extension, your syntax look ok, PHP is 
telling you that it could not load the required extension (module).

the following page from the PHP manual tells more about what you need in 
order to use mcrypt_ functions:

http://nl2.php.net/manual/en/ref.mcrypt.php

I also noticed that you are trying to use the IDEA encryption algorithm; 
 afaik this is only free for use non-commercial use... although you may 
not care ;-)

[EMAIL PROTECTED] wrote:

Hi all,
i've problem with mcrypt_cfb function.
This is the code:
$string = A simple text string;
$key = My key;
line 55: $encrypted = mcrypt_cfb(MCRYPT_IDEA, $key, $string, MCRYPT_ENCRYPT);  
$key = My key;
line 59: $string = mcrypt_cfb(MCRYPT_IDEA, $key, $encrypted, MCRYPT_DECRYPT);  

I've alway this error message:

Warning: mcrypt_cfb(): Module initialization failed in /web/htdocs/www.automationsoft.biz/home/critto.php on line 55
stringa cifrata= 
Warning: mcrypt_cfb(): Module initialization failed in /web/htdocs/www.automationsoft.biz/home/critto.php on line 59
stringa decifrata= 

and I don't know where is the problem..
Is the sintax correct?
I see mcrypt function in PHP manual at www.php.net but I don't find the problem.
Can you explain me how use mcrypt function?
All helps are precious.
Thanks in advance.
Frank
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mcrypt don't work.

2004-02-03 Thread Jas
Have you tried to check if PHP has been compiled with mcrypt?

try this on a page
?php
phpinfo();
?
Look for mcrypt directives, if not there you need to download it and 
compile it like so.
http://mcrypt.sourceforge.net

Get both the libmcrypt and mcrypt compressed archives
from command prompt on linux...
cd /path/to/libmcrypt.xx.tar.gz
gzip -dfrv libmcrypt.xx.tar.gz
tar -xvf libmcrypt.xx.tar
cd libmcrypt.xx/
./config --disable-posix-threads
make
make install
now do the same for mcrypt
cd /path/to/mcrypt.xx.tar.gz
gzip -dfrv mcrypt.xx.tar.gz
tar -xvf mcrypt.xx.tar
cd mcrypt.xx/
./config --disable-posix-threads
make
make install
now you need to compile php for mcrypt support
cd /path/to/php-4.xx
./configure --with-mcrypt=/path/to/libmcrypt/
make
make install
simple, now if your using apache on windows you need to get the windows 
executables from mcrypt.sourceforge.net

Also if mcrypt is already installed simple do a find
find / | grep libmcrypt
from a command prompt to find the libraries, if you cannot find it them 
install it, or just re-compile php to include support.

Hope this helps, it took me awhile to figure it out too.
Jas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] mcrypt win32 install problem ?

2004-01-21 Thread Vincent DUPONT
Hi,
 
I want to use the mcrypt module and I followed the instructions to install the dll for 
Win32 users :
I copied the libmcrypt.dll file under c:\winnt\system32
I uncommented the  extension=php_mcrypt.dll in the php.ini
I restarted the computer
 
I tried many examples available in the Net. The result is always the same : 
I can crypt a plain text but I cannot Uncrypt that text. Do you see any potential 
reason to this?
I guess this problem is related to my computer / configuration...
 
current config 
PHP 4.3.4
Win 2000
PEAR
 
 
php in fo seems correct about mcrypt


Re: [PHP] mcrypt win32 install problem ?

2004-01-21 Thread Tom Rogers
Hi,

Wednesday, January 21, 2004, 9:09:40 PM, you wrote:
VD Hi,
 
VD I want to use the mcrypt module and I followed the
VD instructions to install the dll for Win32 users :
VD I copied the libmcrypt.dll file under c:\winnt\system32
VD I uncommented the  extension=php_mcrypt.dll in the php.ini
VD I restarted the computer
 
VD I tried many examples available in the Net. The result is always the same :
VD I can crypt a plain text but I cannot Uncrypt that text. Do
VD you see any potential reason to this?
VD I guess this problem is related to my computer / configuration...
 
VD current config 
VD PHP 4.3.4
VD Win 2000
VD PEAR
 
 
VD php in fo seems correct about mcrypt

It seems they changed the name of the deinit function in windows, use

mcrypt_generic_end($td);

instead  of
mcrypt_generic_deinit($td);

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mcrypt win32 install problem ?

2004-01-21 Thread speedfreak
Tom Rogers wrote:

 Hi,

 Wednesday, January 21, 2004, 9:09:40 PM, you wrote:
 VD Hi,

 VD I want to use the mcrypt module and I followed the
 VD instructions to install the dll for Win32 users :
 VD I copied the libmcrypt.dll file under c:\winnt\system32
 VD I uncommented the  extension=php_mcrypt.dll in the php.ini
 VD I restarted the computer

 VD I tried many examples available in the Net. The result is always the same :
 VD I can crypt a plain text but I cannot Uncrypt that text. Do
 VD you see any potential reason to this?
 VD I guess this problem is related to my computer / configuration...

 VD current config
 VD PHP 4.3.4
 VD Win 2000
 VD PEAR


 VD php in fo seems correct about mcrypt

 It seems they changed the name of the deinit function in windows, use

 mcrypt_generic_end($td);

 instead  of
 mcrypt_generic_deinit($td);

 --
 regards,
 Tom

Hi Tom, Vincent, list,

Tom, your response caused some confusion here. I have mcrypt running on win32
(Win98, Apache 1.3.29  2.0.48, PHP 4.3.4  PHP 5beta3) and am in fact using
mcrypt_generic_deinit() succesfully to encrypt/decrypt... This in accordance to the
most recent PHP documentation, which exactly opposes your statement:

   mcrypt_generic_end
   (PHP 4 = 4.0.2)
   mcrypt_generic_end -- This function terminates encryption
   Description
   bool mcrypt_generic_end ( resource td)

   Warning
   This function is deprecated, use mcrypt_generic_deinit() instead.
   It can cause crashes when used with mcrypt_module_close() due
   to multiple buffer frees.

So maybe something else is causing Vincent's problem to decrypt. Without further
code snippets it is very hard to pin it down...

Regards,
speedfreak

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] mcrypt win32 install problem ?

2004-01-21 Thread Tom Rogers
Hi,

Thursday, January 22, 2004, 2:16:22 AM, you wrote:

scb Hi Tom, Vincent, list,

scb Tom, your response caused some confusion here. I have mcrypt running on win32
scb (Win98, Apache 1.3.29  2.0.48, PHP 4.3.4  PHP 5beta3) and am in fact using
scb mcrypt_generic_deinit() succesfully to encrypt/decrypt... This in accordance to 
the
scb most recent PHP documentation, which exactly opposes your statement:

scbmcrypt_generic_end
scb(PHP 4 = 4.0.2)
scbmcrypt_generic_end -- This function terminates encryption
scbDescription
scbbool mcrypt_generic_end ( resource td)

scbWarning
scbThis function is deprecated, use mcrypt_generic_deinit() instead.
scbIt can cause crashes when used with mcrypt_module_close() due
scbto multiple buffer frees.

scb So maybe something else is causing Vincent's problem to decrypt. Without further
scb code snippets it is very hard to pin it down...

scb Regards,
scb speedfreak


Yes you are right, it was the php_mycrypt.dll that I downloaded from
where the php manual I have states

(http://ftp.proventum.net/pub/php/win32/misc/mcrypt/)

had that function missing though it is in the
mcrypt.dll itself. I compiled my own version of php_mcrypt.dll and the
function is there now. I better get a newer version of the manual. Sorry about the 
confusion.

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt and PHP to encrypt values to be passed to differend server

2003-12-28 Thread Mark Wouters
Hello!

I'm trying to use mcrypt to encrypt some values (login and password) I have
to pass from one website to another.
I thook this code from the php.net website as an example:

?php
/* Open the cipher */
$td = mcrypt_module_open ('rijndael-256', '', 'ofb', '');

/* Create the IV and determine the keysize length */
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_DEV_RANDOM);
$ks = mcrypt_enc_get_key_size ($td);

/* Create key */
$key = substr (md5 ('very secret key'), 0, $ks);

/* Intialize encryption */
mcrypt_generic_init ($td, $key, $iv);

/* Encrypt data */
$encrypted = mcrypt_generic ($td, 'This is very important data');

/* Terminate encryption handler */
mcrypt_generic_deinit ($td);

/* Initialize encryption module for decryption */
mcrypt_generic_init ($td, $key, $iv);

/* Decrypt encrypted string */
$decrypted = mdecrypt_generic ($td, $encrypted);

/* Terminate decryption handle and close module */
mcrypt_generic_deinit ($td);
mcrypt_module_close ($td);

/* Show string */
echo trim ($decrypted).\n;
?

I put this in the page starting from:

?php
$adminlogin = $row1[adminlogin];
$adminpw = $row1[adminpw];
// both are queried from a database

$td = mcrypt_module_open ('rijndael-256', '', 'ofb', '');
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_DEV_RANDOM);
$ks = mcrypt_enc_get_key_size ($td);
$key = substr (md5 ('a key fsfqz'), 0, $ks);
mcrypt_generic_init ($td, $key, $iv);

/* Encrypt data */
$encryptedlogin = mcrypt_generic ($td, $adminlogin);
$encryptedpassw = mcrypt_generic ($td, $adminpw);

mcrypt_generic_deinit ($td);
mcrypt_module_close ($td);
?
a href=destinationpage.php?login=?php echo($encryptedlogin);
?password=?php echo($encryptedpassw); ? target=_blanklink/a


In the destination page (destinationpage.php, on a different server) I have
this:

  $td = mcrypt_module_open ('rijndael-256', '', 'ofb', '');
  $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td),
MCRYPT_DEV_RANDOM);
  $ks = mcrypt_enc_get_key_size ($td);
  $key = substr (md5 ('a key fsfqz'), 0, $ks);
  mcrypt_generic_init ($td, $key, $iv);

  /* Decrypt encrypted string */
  $login = mdecrypt_generic ($td, $login);
  $login = trim ($login);
  $password = mdecrypt_generic ($td, $password);
  $password = trim ($password);

  mcrypt_generic_deinit ($td);
  mcrypt_module_close ($td);

  and then an echo($login - $passwordbr); to check if the values are
correct.

But they are not!!
What am I doing wrong?? Is it because both are on a different server?
I would very much appreciate your help. Or if someone has an other good way
of encrypting values, please let me know!

Thanks!!!

Mark.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mcrypt and PHP to encrypt values to be passed to differend server

2003-12-28 Thread Tom Rogers
Hi,

Monday, December 29, 2003, 9:30:11 AM, you wrote:
MW Hello!

MW I'm trying to use mcrypt to encrypt some values (login and password) I have
MW to pass from one website to another.


You will need to pass the $iv which kinda defeats the object of it, or
use a null one. Here is a class I use for this which also corrects the
string lengths as decryption will usually have a few /0 tacked on to
make it a block size:

class encrypt_class{
var $secret;
function encrypt_class(){
$this-secret = 'choose your own pass phrase here';
}
Function encode($id){
$eid = $iv = 0;
$len = strlen($id);
$id = $len.'-'.$id;
$td = mcrypt_module_open(MCRYPT_TripleDES, , MCRYPT_MODE_ECB, );
$key = substr($this-secret, 0, mcrypt_enc_get_key_size ($td));
$iv = pack(a.mcrypt_enc_get_iv_size($td),$iv);
mcrypt_generic_init ($td, $key, $iv);
$eid = base64_encode(mcrypt_generic ($td, $id));
mcrypt_generic_deinit($td);
  return $eid;
}
Function decode($eid){
$id = $iv = 0;
$td = mcrypt_module_open (MCRYPT_TripleDES, , MCRYPT_MODE_ECB, );
$key = substr($this-secret, 0, mcrypt_enc_get_key_size ($td));
$iv = pack(a.mcrypt_enc_get_iv_size($td),$iv);
mcrypt_generic_init ($td, $key, $iv);
$id = mdecrypt_generic ($td, base64_decode($eid));
$len = strtok($id,'-');
$id = substr($id,(strlen($len)+1),$len);
mcrypt_generic_deinit($td);
return $id;
}
}
 //usage
 $password = 'password';
 $name = 'me';
 
 $mesage[0] = $password;
 $message[1] = $name;

 $serial = serialize($message);
 
 $enc = new encrypt_class();
 $enc_message = $enc-encode($serial);
 //send message ?enc_message=$enc_message

 //next page
 $enc = new encrypt_class();
 $serial = $enc-decode($_GET['enc_message']);
 $message = unserialize($serial);
 print_r($message);

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mcrypt libraries?

2003-11-19 Thread Jas
Evan Nemerson wrote:
On Tuesday 18 November 2003 01:13 pm, Jas wrote:

Curt Zirzow wrote:

* Thus wrote Jas ([EMAIL PROTECTED]):

I am not sure if I should post my question here but I will anyways.

Ok, I have compiled the mcrypt libraries on a Redhat 9 box running
apache 2 with php4.  And I need to know the next step(s) in getting php
to use the libmcrypt libraries.  If anyone has set this up in the past
or has some pointers (other than reading the manual) I would appreciate
it.
Did you read the next step: Installation
 http://php.net/mcrypt
Curt
Yes I have and I guess I was looking for a method of using the libmcrypt
library without having to recompile php. Sorry for the confusion.


Have you tried using phpize?


Actually I have not, not sure what phpize is but I will look it up.  If 
you know of a URL where some fairly detailed instructions on compiling 
PHP with the mcrypt libraries are please post it.  Thanks again,
Jas

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mcrypt libraries?

2003-11-18 Thread Curt Zirzow
* Thus wrote Jas ([EMAIL PROTECTED]):
 I am not sure if I should post my question here but I will anyways.
 
 Ok, I have compiled the mcrypt libraries on a Redhat 9 box running 
 apache 2 with php4.  And I need to know the next step(s) in getting php 
 to use the libmcrypt libraries.  If anyone has set this up in the past 
 or has some pointers (other than reading the manual) I would appreciate it.

Did you read the next step: Installation
  http://php.net/mcrypt


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
http://zirzow.dyndns.org/html/mlists/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mcrypt libraries?

2003-11-18 Thread Jas
Curt Zirzow wrote:
* Thus wrote Jas ([EMAIL PROTECTED]):

I am not sure if I should post my question here but I will anyways.

Ok, I have compiled the mcrypt libraries on a Redhat 9 box running 
apache 2 with php4.  And I need to know the next step(s) in getting php 
to use the libmcrypt libraries.  If anyone has set this up in the past 
or has some pointers (other than reading the manual) I would appreciate it.


Did you read the next step: Installation
  http://php.net/mcrypt
Curt
Yes I have and I guess I was looking for a method of using the libmcrypt 
library without having to recompile php. Sorry for the confusion.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mcrypt libraries?

2003-11-18 Thread Evan Nemerson
On Tuesday 18 November 2003 01:13 pm, Jas wrote:
 Curt Zirzow wrote:
  * Thus wrote Jas ([EMAIL PROTECTED]):
 I am not sure if I should post my question here but I will anyways.
 
 Ok, I have compiled the mcrypt libraries on a Redhat 9 box running
 apache 2 with php4.  And I need to know the next step(s) in getting php
 to use the libmcrypt libraries.  If anyone has set this up in the past
 or has some pointers (other than reading the manual) I would appreciate
  it.
 
  Did you read the next step: Installation
http://php.net/mcrypt
 
 
  Curt

 Yes I have and I guess I was looking for a method of using the libmcrypt
 library without having to recompile php. Sorry for the confusion.

Have you tried using phpize?


-- 
Evan Nemerson
[EMAIL PROTECTED]
http://coeusgroup.com/en

--
To think is to differ.

-Clarence Darrow

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt libraries?

2003-11-17 Thread Jas
I am not sure if I should post my question here but I will anyways.

Ok, I have compiled the mcrypt libraries on a Redhat 9 box running 
apache 2 with php4.  And I need to know the next step(s) in getting php 
to use the libmcrypt libraries.  If anyone has set this up in the past 
or has some pointers (other than reading the manual) I would appreciate it.
Jas

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] mcrypt Blowfish encryption and Chilcat

2003-08-08 Thread Stephen Holly
Hi all.

I was wondering anyone had heard any issues regarding mcrypt Blowfish
encryption and Chilcat??

I presently have a system with a server implemented in php using
mcrypt-2.4.x and clients who interact with it sending and receiving blowfish
encrypted data. I am unable to touch the clients but want to convert the
server to .NET. However I am not getting the same results and I am pretty
sure my .NET components are correct chilkat.

Any help would be greatly appreciated :o)

Cheers,
Steve.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt mhash

2003-07-30 Thread AECT Listas
Hi,

What is utility of mcrypt and mhash?

Thanks,

_
Charla con tus amigos en línea mediante MSN Messenger: 
http://messenger.yupimsn.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mcrypt mhash

2003-07-30 Thread Evan Nemerson
http://mcrypt.hellug.gr/
http://mhash.sf.net/


On Wednesday 30 July 2003 08:11 pm, AECT Listas wrote:
 Hi,

 What is utility of mcrypt and mhash?

 Thanks,

 _
 Charla con tus amigos en línea mediante MSN Messenger:
 http://messenger.yupimsn.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP / mcrypt compile

2003-07-19 Thread Tom Ray [Lists]
Ok, I've never done this before so I want to double check before I do it.

I'm running RH 7.3 and PHP was installed as a RPM. Now I've just 
installed libmcrypt. My question is when I go to recompile PHP can I 
just run the PHP configure file as configure --with-mcrypt[=DIR] 
--disable-posix-threads or do I need to run the enter configre command 
listed in phpinfo? OR can I just activate it in php.ini since it was an 
RPM install?(and if I can how do I do that command?)

TIA

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mcrypt warning

2003-07-10 Thread Tom Rogers
Hi,

Thursday, July 10, 2003, 12:41:28 AM, you wrote:
DJ Hi All,

DJ I have the following function:

DJ function encrypt ($x) {
DJ $ini = parse_ini_file ($GLOBALS['INI_PATH']);
DJ $td  = mcrypt_module_open ('tripledes', '', 'ecb', '');
DJ $iv  = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td),
DJ MCRYPT_RIJNDAEL_256);

DJ mcrypt_generic_init ($td, $ini[key], $iv);

DJ $encrypted_data = mcrypt_generic ($td, $x);

DJ mcrypt_generic_deinit ($td);
DJ mcrypt_module_close ($td);

DJ return bin2hex($encrypted_data);
DJ }

DJ I get the following PHP Warning in my logs, however, the code executes ok:

DJ [Wed Jul  9 10:25:49 2003] [error] PHP Warning:  mcrypt_generic_init(): Iv
DJ size incorrect; supplied length: 0, needed: 8 in
DJ /usr/local/apache/htdocs-uat-retail/include/nocheck.iostream.class.php on
DJ line 87

DJ I have read into mcrypt, tried a couple things, but nothing will get rid of
DJ that error.  Could someone show me what I've done wrong?

DJ -Dan Joseph

I use this to set iv to null so I don't need to worry about it :)

$iv = pack(a.mcrypt_enc_get_iv_size($td),$iv);

-- 
regards,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] mcrypt warning

2003-07-10 Thread Dan Joseph
Hi,

 I use this to set iv to null so I don't need to worry about it :)
 
 $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv);

Ahh ok, I'll give that a try and let you know how it comes out.  Thanks!

-Dan Joseph

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt warning

2003-07-09 Thread Dan Joseph
Hi All,

I have the following function:

function encrypt ($x) {
$ini = parse_ini_file ($GLOBALS['INI_PATH']);
$td  = mcrypt_module_open ('tripledes', '', 'ecb', '');
$iv  = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td),
MCRYPT_RIJNDAEL_256);

mcrypt_generic_init ($td, $ini[key], $iv);

$encrypted_data = mcrypt_generic ($td, $x);

mcrypt_generic_deinit ($td);
mcrypt_module_close ($td);

return bin2hex($encrypted_data);
}

I get the following PHP Warning in my logs, however, the code executes ok:

[Wed Jul  9 10:25:49 2003] [error] PHP Warning:  mcrypt_generic_init(): Iv
size incorrect; supplied length: 0, needed: 8 in
/usr/local/apache/htdocs-uat-retail/include/nocheck.iostream.class.php on
line 87

I have read into mcrypt, tried a couple things, but nothing will get rid of
that error.  Could someone show me what I've done wrong?

-Dan Joseph


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Mcrypt functions

2003-06-04 Thread Daniel Rychlik
Hello,

I have been playing with the mycrypt function.  Im having a bit of
trouble understanding why it is important to use a vector IV.  

I was wandering if there is a reasonably powerful encryption algorithm.
That uses a key only instead of getting the block size and using a IV.  

I basically want to know if there is something simple out there that
will do the same job.  

Kind Regards,
Daniel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt installation

2003-06-04 Thread Tom Ray [Lists]
I'm just a little curious, I've never really don't this before, but is 
installing mcrypt usually a very hard thing to do, or will it be pretty 
simple for a dolt like me? :)

Thanks.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] mcrypt installation

2003-06-04 Thread Daniel Rychlik
Here is how I installed it and got it working.  This is straight out of
the PHP manual.  You should read it, it helps.
 

LIV. Mcrypt Encryption Functions


Introduction

This is an interface to the mcrypt library, which supports a wide
variety of block algorithms such as DES, TripleDES, Blowfish (default),
3-WAY, SAFER-SK64, SAFER-SK128, TWOFISH, TEA, RC2 and GOST in CBC, OFB,
CFB and ECB cipher modes. Additionally, it supports RC6 and IDEA which
are considered non-free. 
  _  


Requirements

These functions work using  http://mcrypt.hellug.gr/ mcrypt. To use
it, download libmcrypt-x.x.tar.gz from here http://mcrypt.hellug.gr/
and follow the included installation instructions. Windows users will
find all the needed compiled mcrypt binaries here
http://ftp.proventum.net/pub/php/win32/misc/mcrypt/ 
 
 
-Original Message-
From: Tom Ray [Lists] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 03, 2003 3:41 PM
To: PHP List
Subject: [PHP] mcrypt installation
 
I'm just a little curious, I've never really don't this before, but is 
installing mcrypt usually a very hard thing to do, or will it be pretty 
simple for a dolt like me? :)
 
Thanks.
 
 
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] mcrypt as shared module

2003-02-26 Thread Vladimir Fedorkov
How can I attach mcrypt to PHP (FreeBSD) without recompile whole PHP ?
How can I compile mcrypt as PHP shared module ?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mcrypt as shared module

2003-02-26 Thread Jason Sheets
Hello Vladimir, you can run phpize in the mcrypt extension directory in
your PHP source code, then copy the .so file to your PHP extension dir
and either add an extension line to your php.ini file or use dl to load
the extension at run time.  Generally I just compile it in at PHP
configure time as you need write access to the PHP extension directory
anyway.

Jason
On Wed, 2003-02-26 at 14:02, Vladimir Fedorkov wrote:
 How can I attach mcrypt to PHP (FreeBSD) without recompile whole PHP ?
 How can I compile mcrypt as PHP shared module ?
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt dll's for php 4.3.x on windows

2003-02-23 Thread Daniel Guerrier
Hello folks,

I found a working version of the php_mcrypt.dll and
libmcrypt.dll for php 4.3.x. It may working on earlier
versions, but I don't know for sure.

You can download it from:

http://home.earthlink.net/~dguerrier/data/mcrypt.zip

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt not fully decrypting?

2003-02-21 Thread Tyler Longren
Hi,

I'm going to start encrypting credit cards with the mcrypt functions.  I
encrypted the credit cards like so:
$key = 'test';
  $cc = 1234567890123456;
  $td = mcrypt_module_open ('tripledes', '', 'ecb', '');
  $key = substr ($key, 0, mcrypt_enc_get_key_size ($td));
  $iv_size = mcrypt_enc_get_iv_size ($td);
  $iv = mcrypt_create_iv ($iv_size, MCRYPT_RAND);

  // Initialize encryption handle
  if (mcrypt_generic_init ($td, $key, $iv) != -1) {
   // Encrypt data
   $ciphertext = mcrypt_generic ($td, $cc);
   mcrypt_generic_deinit ($td);

   // Reinitialize buffers for decryption
   mcrypt_generic_init ($td, $key, $iv);
   $plaintext = mdecrypt_generic ($td, $ciphertext);

   // Clean up
   mcrypt_generic_deinit ($td);
   mcrypt_module_close ($td);
print font face=Arial size=2bCiphertext:/b $ciphertextBr;
 print bPlaintext:/b $plaintext/font;
  }

Sometimes, when I decrypt a cc it contains binary data...it's not fully
decrypted.  There's some plaintext in it and there's also binary.  Does
anyone know why this happens or how I can fix it?

Thanks,
Tyler


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] mcrypt installation problems

2003-02-05 Thread Jean-Christian Imbeault
Can anyone point to information on how to install mcrypt support for 
PHP. I tried the PHP mcrypt pages but they are quite lacking in details.

I downloaded libmcrypt and got that installed fine.

I also downloaded mcrypt (do I really need it?) but that wouldn't 
configure. It complains that:

checking for libmcrypt - version = 2.5.0... no
*** Could not run libmcrypt test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding LIBMCRYPT or finding the 
wrong ...

I tried compiling PHP with  --with-mcrypt=/usr/src/mcrypt-2.6.3/ (the 
locate of the mcrypt source files) but that gave me an error when I did 
make:

cc1: warning: changing search order for system directory 
/usr/local/include
cc1: warning:   as it has already been specified as a non-system directory
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED 
redefined
In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34:
[...]

Questions:

1- Do I need both libmcrypt AND mcrypt?
2- What is the installation procedure? I tried the obvious ./configure 
 make combination but to no avail ...

Thanks!

Jc


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mcrypt installation problems

2003-02-05 Thread Adam Voigt




Download MCRYPT SRC.

tar -zxf mcrypt.tar.gz

cd mcrypt

./configure --prefix=/usr/local/mcrypt

make

make install

cd /usr/local/php

./configure --with-mcrypt=/usr/local/mcrypt



Replace path's with your own.





On Wed, 2003-02-05 at 09:07, Jean-Christian Imbeault wrote:

Can anyone point to information on how to install mcrypt support for 

PHP. I tried the PHP mcrypt pages but they are quite lacking in details.



I downloaded libmcrypt and got that installed fine.



I also downloaded mcrypt (do I really need it?) but that wouldn't 

configure. It complains that:



checking for libmcrypt - version = 2.5.0... no

*** Could not run libmcrypt test program, checking why...

*** The test program compiled, but did not run. This usually means

*** that the run-time linker is not finding LIBMCRYPT or finding the 

wrong ...



I tried compiling PHP with  --with-mcrypt=/usr/src/mcrypt-2.6.3/ (the 

locate of the mcrypt source files) but that gave me an error when I did 

make:



cc1: warning: changing search order for system directory 

/usr/local/include

cc1: warning:   as it has already been specified as a non-system directory

/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED 

redefined

In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34:

[...]



Questions:



1- Do I need both libmcrypt AND mcrypt?

2- What is the installation procedure? I tried the obvious ./configure 

 make combination but to no avail ...



Thanks!



Jc





-- 

PHP General Mailing List (http://www.php.net/)

To unsubscribe, visit: http://www.php.net/unsub.php






-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


Re: [PHP] mcrypt installation problems

2003-02-05 Thread Jean-Christian Imbeault
Adam Voigt wrote:

Download MCRYPT SRC.
tar -zxf mcrypt.tar.gz
cd mcrypt
./configure --prefix=/usr/local/mcrypt


From the commands you give you imply that libmcrypt is not needed. Are 
you sure?

The configure command you give does not work.

Here's the complete error:

[root@host110 mcrypt-2.6.3]# ./configure --prefix=/usr/local/mcrypt
[delete configure messages ...]
checking for libmcrypt - version = 2.5.0... no
*** Could not run libmcrypt test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding LIBMCRYPT or finding the wrong
*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to 
set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location  Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
***
configure: error: *** libmcrypt was not found


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mcrypt installation problems

2003-02-05 Thread Tom Rogers
Hi,

Thursday, February 6, 2003, 12:07:49 AM, you wrote:
JCI Can anyone point to information on how to install mcrypt support for 
JCI PHP. I tried the PHP mcrypt pages but they are quite lacking in details.

JCI I downloaded libmcrypt and got that installed fine.

JCI I also downloaded mcrypt (do I really need it?) but that wouldn't 
JCI configure. It complains that:

JCI checking for libmcrypt - version = 2.5.0... no
JCI *** Could not run libmcrypt test program, checking why...
JCI *** The test program compiled, but did not run. This usually means
JCI *** that the run-time linker is not finding LIBMCRYPT or finding the 
JCI wrong ...

JCI I tried compiling PHP with  --with-mcrypt=/usr/src/mcrypt-2.6.3/ (the 
JCI locate of the mcrypt source files) but that gave me an error when I did 
JCI make:

JCI cc1: warning: changing search order for system directory 
JCI /usr/local/include
JCI cc1: warning:   as it has already been specified as a non-system directory
JCI /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED 
JCI redefined
JCI In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34:
JCI [...]

JCI Questions:

JCI 1- Do I need both libmcrypt AND mcrypt?
JCI 2- What is the installation procedure? I tried the obvious ./configure 
JCI  make combination but to no avail ...

JCI Thanks!

JCI Jc

I did it this way
untar libmcrypt and mcrypt into /usr/src
then in libmcrypt
./configure --prefix=/usr (could be /usr/local if you want
make
make install
ldconfig
cd ../mcrypt-2.6.3
./configure --prefix=/usr
make
make install

then in php

--with-mcrypt=/usr/src/mcrypt-2.6.3

-- 
regards,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mcrypt installation problems

2003-02-05 Thread Jean-Christian Imbeault
Tom Rogers wrote:


I did it this way
untar libmcrypt and mcrypt into /usr/src
then in libmcrypt
./configure --prefix=/usr (could be /usr/local if you want
make
make install
ldconfig
cd ../mcrypt-2.6.3


Up to here fine.


./configure --prefix=/usr


configure: error: You need at least libmhash 0.8.15 to compile this 
program. http://mhash.sf.net/;

Hum ... the PHP manual nor the mcrypt web site mentionned the need for 
mhash 

Do I really need it?

Jc


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] mcrypt installation problems

2003-02-05 Thread Jason Sheets
You need only libmcrypt, mcrypt is a command line program that is
intended to replace the Unix crypt program.

To build the mcrypt binary you need mhash and libmcrypt, for PHP unless
you want mhash you need only libmcrypt.

Jason

On Wed, 2003-02-05 at 07:07, Jean-Christian Imbeault wrote:
 Can anyone point to information on how to install mcrypt support for 
 PHP. I tried the PHP mcrypt pages but they are quite lacking in details.
 
 I downloaded libmcrypt and got that installed fine.
 
 I also downloaded mcrypt (do I really need it?) but that wouldn't 
 configure. It complains that:
 
 checking for libmcrypt - version = 2.5.0... no
 *** Could not run libmcrypt test program, checking why...
 *** The test program compiled, but did not run. This usually means
 *** that the run-time linker is not finding LIBMCRYPT or finding the 
 wrong ...
 
 I tried compiling PHP with  --with-mcrypt=/usr/src/mcrypt-2.6.3/ (the 
 locate of the mcrypt source files) but that gave me an error when I did 
 make:
 
 cc1: warning: changing search order for system directory 
 /usr/local/include
 cc1: warning:   as it has already been specified as a non-system directory
 /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED 
 redefined
 In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34:
 [...]
 
 Questions:
 
 1- Do I need both libmcrypt AND mcrypt?
 2- What is the installation procedure? I tried the obvious ./configure 
  make combination but to no avail ...
 
 Thanks!
 
 Jc
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mcrypt installation problems

2003-02-05 Thread Jean-Christian Imbeault
Jason Sheets wrote:


You need only libmcrypt, mcrypt is a command line program that is
intended to replace the Unix crypt program.

To build the mcrypt binary you need mhash and libmcrypt, for PHP unless
you want mhash you need only libmcrypt.


Ok, so to build mcrypt support into PHP I only need libmcrypt ... that's it?

I can compile and install that with no errors. But when I try and 
compile PHP I get this big long error error ... Any hints??

gcc  -Iext/mcrypt/ -I/usr/src/php-4.3.0/ext/mcrypt/ -DPHP_ATOM_INC 
-I/usr/src/php-4.3.0/include -I/usr/src/php-4.3.0/main 
-I/usr/src/php-4.3.0 -I/usr/src/php-4.3.0/Zend 
-I/usr/local/psql//include -I/usr/src/php-4.3.0/ext/xml/expat 
-I/usr/src/php-4.3.0/TSRM  -g -O2  -c 
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c -o ext/mcrypt/mcrypt.o   echo  
ext/mcrypt/mcrypt.lo
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED 
redefined
In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34:
/usr/local/include/mcrypt.h:31:1: warning: this is the location of the 
previous definition
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c: In function `zm_startup_mcrypt':
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:279: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:280: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: `MCRYPT_BLOWFISH_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: (Each undeclared identifier 
is reported only once
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: for each function it appears 
in.)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:282: `MCRYPT_BLOWFISH_192' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:283: `MCRYPT_BLOWFISH_256' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:284: `MCRYPT_BLOWFISH_448' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:285: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:286: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:287: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:288: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:289: `MCRYPT_IDEA' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:290: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:291: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:292: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:293: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:294: `MCRYPT_RC2_128' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:295: `MCRYPT_RC2_256' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:296: `MCRYPT_RC2_1024' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:297: `MCRYPT_RC4' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:298: `MCRYPT_RC6_128' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:299: `MCRYPT_RC6_192' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:300: `MCRYPT_RC6_256' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:301: `MCRYPT_SAFER_64' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:302: `MCRYPT_SAFER_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:303: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:304: `MCRYPT_SERPENT_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:305: `MCRYPT_SERPENT_192' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:306: `MCRYPT_SERPENT_256' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:307: `MCRYPT_TWOFISH_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:308: `MCRYPT_TWOFISH_192' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:309: `MCRYPT_TWOFISH_256' 
undeclared (first use in this function)

Re[2]: [PHP] mcrypt installation problems

2003-02-05 Thread Tom Rogers
Hi,

Thursday, February 6, 2003, 12:30:01 AM, you wrote:
JCI Tom Rogers wrote:
 
 I did it this way
 untar libmcrypt and mcrypt into /usr/src
 then in libmcrypt
 ./configure --prefix=/usr (could be /usr/local if you want
 make
 make install
 ldconfig
 cd ../mcrypt-2.6.3

JCI Up to here fine.

 ./configure --prefix=/usr

JCI configure: error: You need at least libmhash 0.8.15 to compile this 
JCI program. http://mhash.sf.net/;

JCI Hum ... the PHP manual nor the mcrypt web site mentionned the need for 
JCI mhash 

JCI Do I really need it?

JCI Jc

Looks that way :)
I also have that in /usr/src and in php as

--with-mhash=/usr/src/mhash-0.8.17

(configured with the same --prefix=?usr

-- 
regards,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mcrypt installation problems

2003-02-05 Thread Jean-Christian Imbeault
Tom Rogers wrote:


Looks that way :)
I also have that in /usr/src and in php as

--with-mhash=/usr/src/mhash-0.8.17


Still no go. Did you compile into php 4.3.0? I finally got libmcrypt, 
mhash and mcrypt to make and install, but can't get PHP to work with 
--with-mcrypt OR --with-mcrypt=/usr/local OR --with-mcrypt=../mcrypt-2.6.3/

I get this big compile error:

gcc  -Iext/mcrypt/ -I/usr/src/php-4.3.0/ext/mcrypt/ -DPHP_ATOM_INC 
-I/usr/src/php-4.3.0/include -I/usr/src/php-4.3.0/main 
-I/usr/src/php-4.3.0 -I/usr/src/php-4.3.0/Zend 
-I/usr/local/psql//include -I/usr/src/php-4.3.0/ext/xml/expat 
-I/usr/src/php-4.3.0/TSRM  -g -O2  -c 
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c -o ext/mcrypt/mcrypt.o   echo  
ext/mcrypt/mcrypt.lo
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:229:1: warning: MCRYPT_FAILED 
redefined
In file included from /usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:34:
/usr/local/include/mcrypt.h:31:1: warning: this is the location of the 
previous definition
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c: In function `zm_startup_mcrypt':
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:279: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:280: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: `MCRYPT_BLOWFISH_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: (Each undeclared identifier 
is reported only once
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:281: for each function it appears 
in.)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:282: `MCRYPT_BLOWFISH_192' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:283: `MCRYPT_BLOWFISH_256' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:284: `MCRYPT_BLOWFISH_448' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:285: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:286: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:287: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:288: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:289: `MCRYPT_IDEA' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:290: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:291: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:292: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:293: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:294: `MCRYPT_RC2_128' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:295: `MCRYPT_RC2_256' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:296: `MCRYPT_RC2_1024' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:297: `MCRYPT_RC4' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:298: `MCRYPT_RC6_128' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:299: `MCRYPT_RC6_192' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:300: `MCRYPT_RC6_256' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:301: `MCRYPT_SAFER_64' undeclared 
(first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:302: `MCRYPT_SAFER_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:303: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from pointer without a cast
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:304: `MCRYPT_SERPENT_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:305: `MCRYPT_SERPENT_192' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:306: `MCRYPT_SERPENT_256' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:307: `MCRYPT_TWOFISH_128' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:308: `MCRYPT_TWOFISH_192' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:309: `MCRYPT_TWOFISH_256' 
undeclared (first use in this function)
/usr/src/php-4.3.0/ext/mcrypt/mcrypt.c:310: warning: passing arg 3 of 
`zend_register_long_constant' makes integer from 

Re: [PHP] mcrypt

2003-01-02 Thread J Smith

As I've said a bunch of times, I hate plugging my own software, but you can 
try cryptopp-php, which should provide all the encryption you need, and it 
works on both UNIX and Windows.

http://www.tutorbuddy.com/software/

J


Alex Piaz wrote:

 As far as I know, there is no mcrypt windows version. You´ll have to try
 to compile it yourself. And don´t ask me how because I don´t know:-)
 
 A sugestion: If you can, change to linux. It´s better and it´s Free.
 
 Regards
 
 Alex
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mcrypt

2003-01-02 Thread Jason Sheets
Actually you should be able to get mcrypt working with PHP on Windows
(mcrypt is not distributed with PHP because of the legal issues
surrounding exporting encryption).

If you visit the PHP manual page for mcrypt at
http://www.php.net/manual/en/ref.mcrypt.php you will see the following
under Requirements: 

Windows users will find all the needed compiled mcrypt binaries here
(http://ftp.proventum.net/pub/php/win32/misc/mcrypt/). 

You should be able to add this as a php extension in your windows
php.ini file and then mcrypt functions should be available to you under
windows, there is no need to use other software.

I'm glad to see mcrypt support for windows because it finally allows me
to use my favorite PHP encryption library between both platforms.

Jason


On Thu, 2003-01-02 at 10:02, J Smith wrote:
 
 As I've said a bunch of times, I hate plugging my own software, but you can 
 try cryptopp-php, which should provide all the encryption you need, and it 
 works on both UNIX and Windows.
 
 http://www.tutorbuddy.com/software/
 
 J
 
 
 Alex Piaz wrote:
 
  As far as I know, there is no mcrypt windows version. You´ll have to try
  to compile it yourself. And don´t ask me how because I don´t know:-)
  
  A sugestion: If you can, change to linux. It´s better and it´s Free.
  
  Regards
  
  Alex
  
  
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mcrypt

2002-12-23 Thread Ysrael Guzmán
Hi, my server is win 2000 server and IIS 5.0 
i wnat to work to MCRYPT, but i don't know...
 
help me please.
 
Por favor yo estoy trabajando con windows 2000 server, y mi servidor web
es un Internet Information Service, trabajo con PHP y Mysql...
deseo encriptar con MCRYPT, pero no viene instalado como hago...
es dificil
 
alguien sabe o a trabajado con esto en windows...
 
AYUDA!
 

Ysrael Guzmán Meza

 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mcrypt

2002-12-23 Thread Alex Piaz
As far as I know, there is no mcrypt windows version. You´ll have to try to 
compile it yourself. And don´t ask me how because I don´t know:-)

A sugestion: If you can, change to linux. It´s better and it´s Free.

Regards

Alex


At 18:33 23/12/2002 -0500, Ysrael Guzmán wrote:
Hi, my server is win 2000 server and IIS 5.0
i wnat to work to MCRYPT, but i don't know...

help me please.

Por favor yo estoy trabajando con windows 2000 server, y mi servidor web
es un Internet Information Service, trabajo con PHP y Mysql...
deseo encriptar con MCRYPT, pero no viene instalado como hago...
es dificil

alguien sabe o a trabajado con esto en windows...

AYUDA!


Ysrael Guzmán Meza



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mcrypt 2.4.x - trouble with small data fields?

2002-11-27 Thread Steve Yates
On my current project I am saving personal info into a MySQL database
for later retrieval.  I have discovered that I have trouble with a few
specific data entries, though the other ~20 work fine.  The two I have
trouble with are a char(2) and a varchar(4) field, the smallest ones in the
table, and they return garbage when decrypted.  Is there a minimum field
size for using mcrypt?  Sample code:

// to encrypt, init once
$mykey = 'keytext';
$td = mcrypt_module_open(MCRYPT_TRIPLEDES,'', MCRYPT_MODE_ECB, '');
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), 1234567890);
$ks = mcrypt_enc_get_key_size ($td);
$key = substr(md5($mykey), 0, $ks);
mcrypt_generic_init($td, $key, $iv);
(...)
$CreditCardExpMonth = mcrypt_generic($td, $_POST['Credit_Card_Exp_Month']);
(...)
// then save to database as part of insert query

If I save/retrieve the fields to/from the database w/o encryption they
save  retrieve fine.  This field is two digits ('02', '11', etc.).  The
other is the year (4 digits).

// to decrypt
// I wrote a function to truncate the returned string at the
// first \0 since mcrypt's decrypt pads the result
echo mydecrypt($data['CCExpMonth']);

function mydecrypt($enc) {
  global $td;
  $str = mdecrypt_generic($td, $enc);
  $pos = strpos($str, \0);
  if ($pos !== false) {
$str = substr($str, 0, $pos);
  }
  return $str;
}

Also as long as I'm posting, mcrypt_generic_deinit() seems to be
undefined on my system?  Is that an mcrypt issue or an interaction between
PHP 4.1.2 and mcrypt 2.4.x?

 - Steve Yates
 - Do trees moving back and forth make the wind blow?

~ Taglines by Taglinator - www.srtware.com ~




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-12 Thread Nick Richardson
I'm trying to load it via php.ini w/ extension=php_mcrypt.dll and
php_mcrypt.dll is in the extension_dir - When php_mcrypt.dll is not in
the right place, it tells me it can't load the dll.

Is there something other than the cygwin1.dll and php_mcrypt.dll that I
have to install on the system - all the documentation (what little there
is that I have found) has said that I don't need anything other than
these 2 files.

-Original Message-
From: Ray Hunter [mailto:[EMAIL PROTECTED]] 
Sent: Monday, November 11, 2002 12:48 PM
To: Nick Richardson
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?


Basically, 

Are you loading the dll via the file or php?  Make sure that the
directory(s) where the dlls are located are in your windows path.

If that doesnt work then you can always put the dll in your systems dll
directory...


On Mon, 2002-11-11 at 19:58, Nick Richardson wrote:
 Ok, another question if you can help.
 
 I have (I think) all the components I need (cygwin1.dll, 
 php_mcrypt.dll, etc...).  Php_mcrypt.dll is in the PHP dir, everything

 else is in %windir%.
 
 When I try to use any of the mcrypt stuff now, I get:
 
 PHP Warning: Unable to load dynamic library './php_mcrypt.dll' - The 
 specified procedure could not be found. in Unknown on line 0
 
 You have any idea what I might be doing wrong?
 
 //Nick
 
 -Original Message-
 From: .: B i g D o g :. [mailto:[EMAIL PROTECTED]]
 Sent: Monday, November 11, 2002 4:50 AM
 To: Nick Richardson
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?
 
 
 You need to uncomment the dll in the php.ini file...do a search for it

 and then uncomment it or add it to the php.ini file...
 
 That will load it...
 
 *Note: i would add that directory to your path that contains the 
 mcrypt dll or all dlls for php and the extension directory to...
 
 
 On Mon, 2002-11-11 at 19:42, Nick Richardson wrote:
  Yes, there is a DLL for it, but getting PHP to know it is there is
  where I'm having the problem - I don?t know how to get PHP to under 
  windows to do the equivalent of --with-mcrypt in configure under 
  linux. - maybe I havn't registered the mcrypt dll's correctly or 
  something like that... But I just can't get it to work.
  
  Everytime I try to do it I get 'call to undefined function . '
  
  //Nick
  
  -Original Message-
  From: .: B i g D o g :. [mailto:[EMAIL PROTECTED]]
  Sent: Monday, November 11, 2002 4:37 AM
  To: Nick Richardson
  Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32?
  
  
  
  is there not a dll for mcrypt?
  
  
  On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
   I asked this before, but didn't get a response.
   
   Anyone out there have any experience a/o know where I can find 
   information on getting the mcrypt functionality to work under 
   Win32
 -
   I have found a port of mcrypt for Win32, and also learned that you
 can
  
   compile it using cygwin - but I don?t know how to register mcrypt 
   w/ PHP and 'turn on' the mcrypt* functions.
   
   If anyone has any information or urls / how-tos it would be 
   greatly appreciated!
   
   Thanks!
   
   //Nick Richardson
   // [EMAIL PROTECTED]
   
   
   ---
   Outgoing mail is certified Virus Free. Can McAfee do that? - Hell
   NO!
   Checked by AVG anti-virus system (http://www.grisoft.com).
   Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002

  --
  .: B i g D o g :.
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  ---
  Outgoing mail is certified Virus Free. Can McAfee do that? - Hell 
  NO!
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
   
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 --
 .: B i g D o g :.
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 ---
 Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! 
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
  
-- 
Thank you,

Ray Hunter


---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-12 Thread Nick Richardson
Still having problems getting mcrypt to work under Windows.  But I think
I have narrowed it down to me not having the correct version of
php_mcrypt.dll.

I downloaded the source for PHP and attempted to compile this myself,
but can not get it to work.  If anyone has any information about where I
can get a current php_mcrypt.dll or how I can compile it from the php
source (and don’t say google, because I've been there already), please
let me know.

I'm about to lose my mind!!

Thanks!
//Nick

-Original Message-
From: Nick Richardson [mailto:esoteric.web;gte.net] 
Sent: Tuesday, November 12, 2002 12:18 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?


I'm trying to load it via php.ini w/ extension=php_mcrypt.dll and
php_mcrypt.dll is in the extension_dir - When php_mcrypt.dll is not in
the right place, it tells me it can't load the dll.

Is there something other than the cygwin1.dll and php_mcrypt.dll that I
have to install on the system - all the documentation (what little there
is that I have found) has said that I don't need anything other than
these 2 files.

-Original Message-
From: Ray Hunter [mailto:rhunter;venticon.com] 
Sent: Monday, November 11, 2002 12:48 PM
To: Nick Richardson
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?


Basically, 

Are you loading the dll via the file or php?  Make sure that the
directory(s) where the dlls are located are in your windows path.

If that doesnt work then you can always put the dll in your systems dll
directory...


On Mon, 2002-11-11 at 19:58, Nick Richardson wrote:
 Ok, another question if you can help.
 
 I have (I think) all the components I need (cygwin1.dll,
 php_mcrypt.dll, etc...).  Php_mcrypt.dll is in the PHP dir, everything

 else is in %windir%.
 
 When I try to use any of the mcrypt stuff now, I get:
 
 PHP Warning: Unable to load dynamic library './php_mcrypt.dll' - The
 specified procedure could not be found. in Unknown on line 0
 
 You have any idea what I might be doing wrong?
 
 //Nick
 
 -Original Message-
 From: .: B i g D o g :. [mailto:bigdog;venticon.com]
 Sent: Monday, November 11, 2002 4:50 AM
 To: Nick Richardson
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?
 
 
 You need to uncomment the dll in the php.ini file...do a search for it

 and then uncomment it or add it to the php.ini file...
 
 That will load it...
 
 *Note: i would add that directory to your path that contains the
 mcrypt dll or all dlls for php and the extension directory to...
 
 
 On Mon, 2002-11-11 at 19:42, Nick Richardson wrote:
  Yes, there is a DLL for it, but getting PHP to know it is there is 
  where I'm having the problem - I don?t know how to get PHP to under 
  windows to do the equivalent of --with-mcrypt in configure under 
  linux. - maybe I havn't registered the mcrypt dll's correctly or 
  something like that... But I just can't get it to work.
  
  Everytime I try to do it I get 'call to undefined function . '
  
  //Nick
  
  -Original Message-
  From: .: B i g D o g :. [mailto:bigdog;venticon.com]
  Sent: Monday, November 11, 2002 4:37 AM
  To: Nick Richardson
  Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32?
  
  
  
  is there not a dll for mcrypt?
  
  
  On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
   I asked this before, but didn't get a response.
   
   Anyone out there have any experience a/o know where I can find
   information on getting the mcrypt functionality to work under 
   Win32
 -
   I have found a port of mcrypt for Win32, and also learned that you
 can
  
   compile it using cygwin - but I don?t know how to register mcrypt
   w/ PHP and 'turn on' the mcrypt* functions.
   
   If anyone has any information or urls / how-tos it would be
   greatly appreciated!
   
   Thanks!
   
   //Nick Richardson
   // [EMAIL PROTECTED]
   
   
   ---
   Outgoing mail is certified Virus Free. Can McAfee do that? - Hell 
   NO! Checked by AVG anti-virus system (http://www.grisoft.com).
   Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002

  --
  .: B i g D o g :.
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  ---
  Outgoing mail is certified Virus Free. Can McAfee do that? - Hell
  NO!
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
   
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 --
 .: B i g D o g :.
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 ---
 Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
  
-- 
Thank you,

Ray Hunter

RE: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-12 Thread BigDog
Can u not get it from php.net...the zip file that contains all the
extensions and dlls...not the installer...

That should have the one that you need.

I am still thinking it is an issue with the path...it took me about a
week to get it all working...


On Tue, 2002-11-12 at 23:08, Nick Richardson wrote:
 Still having problems getting mcrypt to work under Windows.  But I think
 I have narrowed it down to me not having the correct version of
 php_mcrypt.dll.
 
 I downloaded the source for PHP and attempted to compile this myself,
 but can not get it to work.  If anyone has any information about where I
 can get a current php_mcrypt.dll or how I can compile it from the php
 source (and donÿt say google, because I've been there already), please
 let me know.
 
 I'm about to lose my mind!!
 
 Thanks!
 //Nick
 
 -Original Message-
 From: Nick Richardson [mailto:esoteric.web;gte.net] 
 Sent: Tuesday, November 12, 2002 12:18 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?
 
 
 I'm trying to load it via php.ini w/ extension=php_mcrypt.dll and
 php_mcrypt.dll is in the extension_dir - When php_mcrypt.dll is not in
 the right place, it tells me it can't load the dll.
 
 Is there something other than the cygwin1.dll and php_mcrypt.dll that I
 have to install on the system - all the documentation (what little there
 is that I have found) has said that I don't need anything other than
 these 2 files.
 
 -Original Message-
 From: Ray Hunter [mailto:rhunter;venticon.com] 
 Sent: Monday, November 11, 2002 12:48 PM
 To: Nick Richardson
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?
 
 
 Basically, 
 
 Are you loading the dll via the file or php?  Make sure that the
 directory(s) where the dlls are located are in your windows path.
 
 If that doesnt work then you can always put the dll in your systems dll
 directory...
 
 
 On Mon, 2002-11-11 at 19:58, Nick Richardson wrote:
  Ok, another question if you can help.
  
  I have (I think) all the components I need (cygwin1.dll,
  php_mcrypt.dll, etc...).  Php_mcrypt.dll is in the PHP dir, everything
 
  else is in %windir%.
  
  When I try to use any of the mcrypt stuff now, I get:
  
  PHP Warning: Unable to load dynamic library './php_mcrypt.dll' - The
  specified procedure could not be found. in Unknown on line 0
  
  You have any idea what I might be doing wrong?
  
  //Nick
  
  -Original Message-
  From: .: B i g D o g :. [mailto:bigdog;venticon.com]
  Sent: Monday, November 11, 2002 4:50 AM
  To: Nick Richardson
  Cc: [EMAIL PROTECTED]
  Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?
  
  
  You need to uncomment the dll in the php.ini file...do a search for it
 
  and then uncomment it or add it to the php.ini file...
  
  That will load it...
  
  *Note: i would add that directory to your path that contains the
  mcrypt dll or all dlls for php and the extension directory to...
  
  
  On Mon, 2002-11-11 at 19:42, Nick Richardson wrote:
   Yes, there is a DLL for it, but getting PHP to know it is there is 
   where I'm having the problem - I don?t know how to get PHP to under 
   windows to do the equivalent of --with-mcrypt in configure under 
   linux. - maybe I havn't registered the mcrypt dll's correctly or 
   something like that... But I just can't get it to work.
   
   Everytime I try to do it I get 'call to undefined function . '
   
   //Nick
   
   -Original Message-
   From: .: B i g D o g :. [mailto:bigdog;venticon.com]
   Sent: Monday, November 11, 2002 4:37 AM
   To: Nick Richardson
   Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32?
   
   
   
   is there not a dll for mcrypt?
   
   
   On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
I asked this before, but didn't get a response.

Anyone out there have any experience a/o know where I can find
information on getting the mcrypt functionality to work under 
Win32
  -
I have found a port of mcrypt for Win32, and also learned that you
  can
   
compile it using cygwin - but I don?t know how to register mcrypt
w/ PHP and 'turn on' the mcrypt* functions.

If anyone has any information or urls / how-tos it would be
greatly appreciated!

Thanks!

//Nick Richardson
// [EMAIL PROTECTED]


---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell 
NO! Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 
   --
   .: B i g D o g :.
   
   
   
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
   
   ---
   Outgoing mail is certified Virus Free. Can McAfee do that? - Hell
   NO!
   Checked by AVG anti-virus system (http://www.grisoft.com).
   Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002

   
   
   --
   PHP General Mailing

RE: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-11 Thread Nick Richardson
Yes, there is a DLL for it, but getting PHP to know it is there is where
I'm having the problem - I don’t know how to get PHP to under windows to
do the equivalent of --with-mcrypt in configure under linux. - maybe I
havn't registered the mcrypt dll's correctly or something like that...
But I just can't get it to work.

Everytime I try to do it I get 'call to undefined function . '

//Nick

-Original Message-
From: .: B i g D o g :. [mailto:bigdog;venticon.com] 
Sent: Monday, November 11, 2002 4:37 AM
To: Nick Richardson
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32?



is there not a dll for mcrypt?


On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
 I asked this before, but didn't get a response.
 
 Anyone out there have any experience a/o know where I can find 
 information on getting the mcrypt functionality to work under Win32 - 
 I have found a port of mcrypt for Win32, and also learned that you can

 compile it using cygwin - but I don’t know how to register mcrypt w/ 
 PHP and 'turn on' the mcrypt* functions.
 
 If anyone has any information or urls / how-tos it would be greatly 
 appreciated!
 
 Thanks!
 
 //Nick Richardson
 // [EMAIL PROTECTED]
 
 
 ---
 Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! 
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
  
-- 
.: B i g D o g :.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-11 Thread .: B i g D o g :.
You need to uncomment the dll in the php.ini file...do a search for it
and then uncomment it or add it to the php.ini file...

That will load it...

*Note: i would add that directory to your path that contains the mcrypt
dll or all dlls for php and the extension directory to...


On Mon, 2002-11-11 at 19:42, Nick Richardson wrote:
 Yes, there is a DLL for it, but getting PHP to know it is there is where
 I'm having the problem - I don’t know how to get PHP to under windows to
 do the equivalent of --with-mcrypt in configure under linux. - maybe I
 havn't registered the mcrypt dll's correctly or something like that...
 But I just can't get it to work.
 
 Everytime I try to do it I get 'call to undefined function . '
 
 //Nick
 
 -Original Message-
 From: .: B i g D o g :. [mailto:bigdog;venticon.com] 
 Sent: Monday, November 11, 2002 4:37 AM
 To: Nick Richardson
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32?
 
 
 
 is there not a dll for mcrypt?
 
 
 On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
  I asked this before, but didn't get a response.
  
  Anyone out there have any experience a/o know where I can find 
  information on getting the mcrypt functionality to work under Win32 - 
  I have found a port of mcrypt for Win32, and also learned that you can
 
  compile it using cygwin - but I don’t know how to register mcrypt w/ 
  PHP and 'turn on' the mcrypt* functions.
  
  If anyone has any information or urls / how-tos it would be greatly 
  appreciated!
  
  Thanks!
  
  //Nick Richardson
  // [EMAIL PROTECTED]
  
  
  ---
  Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! 
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
   
 -- 
 .: B i g D o g :.
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 ---
 Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
  
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
.: B i g D o g :.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-11 Thread Nick Richardson
I will try that - Thanks for the suggestion.  If it was something that
simple, I'm going to shoot myself :)

Thanks!

//Nick

-Original Message-
From: .: B i g D o g :. [mailto:bigdog;venticon.com] 
Sent: Monday, November 11, 2002 4:50 AM
To: Nick Richardson
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?


You need to uncomment the dll in the php.ini file...do a search for it
and then uncomment it or add it to the php.ini file...

That will load it...

*Note: i would add that directory to your path that contains the mcrypt
dll or all dlls for php and the extension directory to...


On Mon, 2002-11-11 at 19:42, Nick Richardson wrote:
 Yes, there is a DLL for it, but getting PHP to know it is there is 
 where I'm having the problem - I don’t know how to get PHP to under 
 windows to do the equivalent of --with-mcrypt in configure under 
 linux. - maybe I havn't registered the mcrypt dll's correctly or 
 something like that... But I just can't get it to work.
 
 Everytime I try to do it I get 'call to undefined function . '
 
 //Nick
 
 -Original Message-
 From: .: B i g D o g :. [mailto:bigdog;venticon.com]
 Sent: Monday, November 11, 2002 4:37 AM
 To: Nick Richardson
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32?
 
 
 
 is there not a dll for mcrypt?
 
 
 On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
  I asked this before, but didn't get a response.
  
  Anyone out there have any experience a/o know where I can find
  information on getting the mcrypt functionality to work under Win32
- 
  I have found a port of mcrypt for Win32, and also learned that you
can
 
  compile it using cygwin - but I don’t know how to register mcrypt w/
  PHP and 'turn on' the mcrypt* functions.
  
  If anyone has any information or urls / how-tos it would be greatly
  appreciated!
  
  Thanks!
  
  //Nick Richardson
  // [EMAIL PROTECTED]
  
  
  ---
  Outgoing mail is certified Virus Free. Can McAfee do that? - Hell 
  NO!
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
   
 --
 .: B i g D o g :.
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 ---
 Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! 
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
  
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
.: B i g D o g :.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Mcrypt Under IIS 5 / Win32?

2002-11-11 Thread Nick Richardson
I asked this before, but didn't get a response.

Anyone out there have any experience a/o know where I can find
information on getting the mcrypt functionality to work under Win32 - I
have found a port of mcrypt for Win32, and also learned that you can
compile it using cygwin - but I don’t know how to register mcrypt w/ PHP
and 'turn on' the mcrypt* functions.

If anyone has any information or urls / how-tos it would be greatly
appreciated!

Thanks!

//Nick Richardson
// [EMAIL PROTECTED]


---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 



Re: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-11 Thread .: B i g D o g :.

is there not a dll for mcrypt?


On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
 I asked this before, but didn't get a response.
 
 Anyone out there have any experience a/o know where I can find
 information on getting the mcrypt functionality to work under Win32 - I
 have found a port of mcrypt for Win32, and also learned that you can
 compile it using cygwin - but I don’t know how to register mcrypt w/ PHP
 and 'turn on' the mcrypt* functions.
 
 If anyone has any information or urls / how-tos it would be greatly
 appreciated!
 
 Thanks!
 
 //Nick Richardson
 // [EMAIL PROTECTED]
 
 
 ---
 Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
  
-- 
.: B i g D o g :.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-11 Thread Nick Richardson
Ok, another question if you can help.

I have (I think) all the components I need (cygwin1.dll, php_mcrypt.dll,
etc...).  Php_mcrypt.dll is in the PHP dir, everything else is in
%windir%.

When I try to use any of the mcrypt stuff now, I get:

PHP Warning: Unable to load dynamic library './php_mcrypt.dll' - The
specified procedure could not be found. in Unknown on line 0 

You have any idea what I might be doing wrong?

//Nick

-Original Message-
From: .: B i g D o g :. [mailto:bigdog;venticon.com] 
Sent: Monday, November 11, 2002 4:50 AM
To: Nick Richardson
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?


You need to uncomment the dll in the php.ini file...do a search for it
and then uncomment it or add it to the php.ini file...

That will load it...

*Note: i would add that directory to your path that contains the mcrypt
dll or all dlls for php and the extension directory to...


On Mon, 2002-11-11 at 19:42, Nick Richardson wrote:
 Yes, there is a DLL for it, but getting PHP to know it is there is 
 where I'm having the problem - I don’t know how to get PHP to under 
 windows to do the equivalent of --with-mcrypt in configure under 
 linux. - maybe I havn't registered the mcrypt dll's correctly or 
 something like that... But I just can't get it to work.
 
 Everytime I try to do it I get 'call to undefined function . '
 
 //Nick
 
 -Original Message-
 From: .: B i g D o g :. [mailto:bigdog;venticon.com]
 Sent: Monday, November 11, 2002 4:37 AM
 To: Nick Richardson
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32?
 
 
 
 is there not a dll for mcrypt?
 
 
 On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
  I asked this before, but didn't get a response.
  
  Anyone out there have any experience a/o know where I can find
  information on getting the mcrypt functionality to work under Win32
- 
  I have found a port of mcrypt for Win32, and also learned that you
can
 
  compile it using cygwin - but I don’t know how to register mcrypt w/
  PHP and 'turn on' the mcrypt* functions.
  
  If anyone has any information or urls / how-tos it would be greatly
  appreciated!
  
  Thanks!
  
  //Nick Richardson
  // [EMAIL PROTECTED]
  
  
  ---
  Outgoing mail is certified Virus Free. Can McAfee do that? - Hell 
  NO!
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
   
 --
 .: B i g D o g :.
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 ---
 Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! 
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
  
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
.: B i g D o g :.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Mcrypt Under IIS 5 / Win32?

2002-11-11 Thread Ray Hunter
Basically, 

Are you loading the dll via the file or php?  Make sure that the
directory(s) where the dlls are located are in your windows path.

If that doesnt work then you can always put the dll in your systems dll
directory...


On Mon, 2002-11-11 at 19:58, Nick Richardson wrote:
 Ok, another question if you can help.
 
 I have (I think) all the components I need (cygwin1.dll, php_mcrypt.dll,
 etc...).  Php_mcrypt.dll is in the PHP dir, everything else is in
 %windir%.
 
 When I try to use any of the mcrypt stuff now, I get:
 
 PHP Warning: Unable to load dynamic library './php_mcrypt.dll' - The
 specified procedure could not be found. in Unknown on line 0 
 
 You have any idea what I might be doing wrong?
 
 //Nick
 
 -Original Message-
 From: .: B i g D o g :. [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, November 11, 2002 4:50 AM
 To: Nick Richardson
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] Mcrypt Under IIS 5 / Win32?
 
 
 You need to uncomment the dll in the php.ini file...do a search for it
 and then uncomment it or add it to the php.ini file...
 
 That will load it...
 
 *Note: i would add that directory to your path that contains the mcrypt
 dll or all dlls for php and the extension directory to...
 
 
 On Mon, 2002-11-11 at 19:42, Nick Richardson wrote:
  Yes, there is a DLL for it, but getting PHP to know it is there is 
  where I'm having the problem - I dont know how to get PHP to under 
  windows to do the equivalent of --with-mcrypt in configure under 
  linux. - maybe I havn't registered the mcrypt dll's correctly or 
  something like that... But I just can't get it to work.
  
  Everytime I try to do it I get 'call to undefined function . '
  
  //Nick
  
  -Original Message-
  From: .: B i g D o g :. [mailto:[EMAIL PROTECTED]]
  Sent: Monday, November 11, 2002 4:37 AM
  To: Nick Richardson
  Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Subject: Re: [PHP] Mcrypt Under IIS 5 / Win32?
  
  
  
  is there not a dll for mcrypt?
  
  
  On Mon, 2002-11-11 at 19:34, Nick Richardson wrote:
   I asked this before, but didn't get a response.
   
   Anyone out there have any experience a/o know where I can find
   information on getting the mcrypt functionality to work under Win32
 - 
   I have found a port of mcrypt for Win32, and also learned that you
 can
  
   compile it using cygwin - but I dont know how to register mcrypt w/
   PHP and 'turn on' the mcrypt* functions.
   
   If anyone has any information or urls / how-tos it would be greatly
   appreciated!
   
   Thanks!
   
   //Nick Richardson
   // [EMAIL PROTECTED]
   
   
   ---
   Outgoing mail is certified Virus Free. Can McAfee do that? - Hell 
   NO!
   Checked by AVG anti-virus system (http://www.grisoft.com).
   Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002

  --
  .: B i g D o g :.
  
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  ---
  Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO! 
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
   
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 -- 
 .: B i g D o g :.
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 ---
 Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
  
-- 
Thank you,

Ray Hunter



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Mcrypt under Win32?

2002-11-10 Thread Nick Richardson

Anyone out there know how to get the mcrypt functions running under
Win32?

Any help / how-to's / URLs will be greatly appreciated. - I have
searched around the web and found a few things, but nothing that really
gives any good information

Thanks in advance for the help!!! 

//Nick Richardson
// [EMAIL PROTECTED]

---
Outgoing mail is certified Virus Free. Can McAfee do that? - Hell NO!
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.408 / Virus Database: 230 - Release Date: 10/24/2002
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mcrypt vs. libmcrypt

2002-10-03 Thread Scott Fletcher

I saw on Google search result about PHP and mcrypt.  I read the manual on
http://php.net/mcrypt and it spoke about downloading libmcrypt and use the
php configure option, --with-mcrypt= for libmcrypt-2.x.x.  So, on the
Google search result, one of hte posting talk about using both the libmcrypt
and mcrypt.

So, what is the difference between these two?  Do I need to install both of
them or just libmcrypt??

Thanks,
 FletchSOD



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mcrypt

2002-08-01 Thread Randy Johnson

I am looking into different password encryption solutions.

i started using crypt()

then changed to mcrypt()

which was not any good cause of the high ascii characters

then i read about converting the high ascii characters to hex .

Is this the ideal way to encrypt passwords or is their something better.

Thanks 

Randy



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mcrypt

2002-08-01 Thread Danny Shepherd

Just base64 encode the mcrypt output if the non printable chars bother you,
though I don't really see what the problem is, unless you're pushing the
output to a web page.

Danny.


- Original Message -
From: Randy Johnson [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 4:24 PM
Subject: [PHP] mcrypt


 I am looking into different password encryption solutions.

 i started using crypt()

 then changed to mcrypt()

 which was not any good cause of the high ascii characters

 then i read about converting the high ascii characters to hex .

 Is this the ideal way to encrypt passwords or is their something better.

 Thanks

 Randy



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] mcrypt

2002-08-01 Thread Darren Gamble

Good day,

 i started using crypt()
 
 then changed to mcrypt()
 
 which was not any good cause of the high ascii characters
 
 then i read about converting the high ascii characters to hex .
 
 Is this the ideal way to encrypt passwords or is their 
 something better.

The crypt() function will generate a standard UNIX crypt password that other
programs can understand.  UNIX crypt has some limitations (only using the
first 8 characters is the major one) but it's good enough for most people
and is probably the most widely supported.

If you want something stronger, you can use md5().  The examples on php's
documentation for this function should help you if you're interested in
having other programs use it (to have it the right format and length).


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mcrypt

2002-08-01 Thread Randy Johnson

I found that the some of the high ascii characters would not store right in
the database or something cause when i went to compare them, the comparison
would fail.


Randy

- Original Message -
From: Danny Shepherd [EMAIL PROTECTED]
To: Randy Johnson [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 11:31 AM
Subject: Re: [PHP] mcrypt


 Just base64 encode the mcrypt output if the non printable chars bother
you,
 though I don't really see what the problem is, unless you're pushing the
 output to a web page.

 Danny.


 - Original Message -
 From: Randy Johnson [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, August 01, 2002 4:24 PM
 Subject: [PHP] mcrypt


  I am looking into different password encryption solutions.
 
  i started using crypt()
 
  then changed to mcrypt()
 
  which was not any good cause of the high ascii characters
 
  then i read about converting the high ascii characters to hex .
 
  Is this the ideal way to encrypt passwords or is their something better.
 
  Thanks
 
  Randy
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mcrypt

2002-08-01 Thread Danny Shepherd

Try setting the database field type to 'BLOB'

Danny.

- Original Message -
From: Randy Johnson [EMAIL PROTECTED]
To: Danny Shepherd [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 4:51 PM
Subject: Re: [PHP] mcrypt


 I found that the some of the high ascii characters would not store right
in
 the database or something cause when i went to compare them, the
comparison
 would fail.


 Randy

 - Original Message -
 From: Danny Shepherd [EMAIL PROTECTED]
 To: Randy Johnson [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, August 01, 2002 11:31 AM
 Subject: Re: [PHP] mcrypt


  Just base64 encode the mcrypt output if the non printable chars bother
 you,
  though I don't really see what the problem is, unless you're pushing the
  output to a web page.
 
  Danny.
 
 
  - Original Message -
  From: Randy Johnson [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Thursday, August 01, 2002 4:24 PM
  Subject: [PHP] mcrypt
 
 
   I am looking into different password encryption solutions.
  
   i started using crypt()
  
   then changed to mcrypt()
  
   which was not any good cause of the high ascii characters
  
   then i read about converting the high ascii characters to hex .
  
   Is this the ideal way to encrypt passwords or is their something
better.
  
   Thanks
  
   Randy
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mcrypt

2002-07-31 Thread J Smith


If all you need is some generic encryption that doesn't require mcrypt, you 
might want to take a look at a crypto extension I wrote called 
cryptopp-php. It does everything that the mcrypt extension does and might 
be a touch easier to use as far as syntax and such goes. (Plus, it works on 
Windows if you're into that sort of thing.) It's fairly stable at the 
moment, and doesn't have the memory allocation problems.

See http://www.tutorbuddy.com/software/, and 
http://www.tutorbuddy.com/software/cryptopp/ for the manual.

(I hate the shameless plugging, but the more people who use my extension the 
easier it is for me to debug...)

J


Purushotham Komaravolu wrote:

 Hi,
  Thanks for the prompt answer. But I am still getting the same error.
 
 /
 original: meet at secret place
 encrypted: d40d72f1b224b9bf86a7dbc52402c1d02a5cf90adb9050f0
 
 Warning: mcrypt_generic_init: Memory allocation error in
 
/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
 tml/time/cancelsubscription/new.php on line 29
 
 Warning: mdecrypt_generic(): 2 is not a valid MCrypt resource in
 
/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
 tml/time/cancelsubscription/new.php on line 30
 
 Warning: mcrypt_generic_end(): 2 is not a valid MCrypt resource in
 
/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
 tml/time/cancelsubscription/new.php on line 31
 decrypted:
 
 
 ///
 
 
 Regards,
 
 Purushotham Komaravolu
 Software Engineer
 Yaga, Inc. - advanced payment services
 Direct: 415-901-7343
 Fax: 415-901-1586
 http://www.yaga.com
 
 
 
 - Original Message -
 From: Tech Support [EMAIL PROTECTED]
 To: Purushotham Komaravolu [EMAIL PROTECTED]
 Sent: Tuesday, July 30, 2002 11:34 AM
 Subject: Re: [PHP] mcrypt
 
 
 Rather than tease you with hints I'll give you some working code ;-)

 Documentation for practical usage of mcrypt is weak. I agree.

 ?
 // crypto.inc
 $key = secret key crap;

 function hex2bin($data)
 {
 $len = strlen($data);
 return pack(H . $len, $data);
 }

 function encrypt($string, $key)
 {
  // version 2.4.x of lib mcrypt
  $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);
  $crypted = mcrypt_generic ($td, $string);
  mcrypt_generic_end ($td);
  return bin2hex($crypted);
 }

 function decrypt($string, $key)
 {
  //version 2.4.x of lib mcrypt
  $string = hex2bin($string);
  $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);
  $decrypted = mdecrypt_generic ($td, $string);
  mcrypt_generic_end ($td);
  return trim($decrypted);
 }
 ?


 usage:
 ?
 include (path/to/crypto.inc);
 $secret = meet at secret place;
 $encrypted = encrypt($secret, $key);
 print original:  . $secret . br;
 print encrypted:  . $encrypted . br;
 $decrypted = decrypt($encrypted, $key);
 print decrypted:  . $decrypted . br;
 ?

 Note: if you are encrypting really secret crap like credit card numbers
 or something of that nature then NEVER include the key anywhere in your
 code. Make a form where you have to type it in or something in order to
 display the results.


 Jim Grill
 Support
 Web-1 Hosting
 http://www.web-1hosting.net
 - Original Message -
 From: Purushotham Komaravolu [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Tuesday, July 30, 2002 12:52 PM
 Subject: [PHP] mcrypt


 Hello,
   I am getting some odd errors trying to get an encrypt/decrypt
 process to
   work. Looking at the manual examples and some other literature, I
 have
 tried
   the two approaches listed below. For each, I get a sometimes-works,
   sometimes fails result. The manual entry has a string of user notes
 with
   problem like mine, but I still have problems.



   Server API Apache



   mcrypt
 mcrypt support enabled
 version 2.4.x
 Supported ciphers twofish rijndael-128 rijndael-192
 rijndael-256
   saferplus rc2 xtea serpent safer-sk64 safer-sk128 cast-256 loki97
 gost
   threeway cast-128 des tripledes enigma arcfour panama wake
 Supported modes ofb cfb nofb cbc ecb stream


   --]



   The first attempt used the following code:


   --
   ?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);
   $decrypted_data

Re: [PHP] mcrypt

2002-07-30 Thread Tech Support

Cross posting this with php-dev might not be the best idea. The dev list is
not for support unless you are trying to code part of the php source.

So this is only failing on the decrypt side of the code?

Memory allocation error does not sound like a problem specific to this
function. All the other errors are just because mcrypt_generic_init failed.

Try only encrypting in one script and then only decrypting in another script
and see what happens.

What are the specs of your system? compile options, platform, etc.?

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: Purushotham Komaravolu [EMAIL PROTECTED]
To: Tech Support [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 1:44 PM
Subject: Re: [PHP] mcrypt


 Hi,
  Thanks for the prompt answer. But I am still getting the same error.

 /
 original: meet at secret place
 encrypted: d40d72f1b224b9bf86a7dbc52402c1d02a5cf90adb9050f0

 Warning: mcrypt_generic_init: Memory allocation error in

/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
 tml/time/cancelsubscription/new.php on line 29

 Warning: mdecrypt_generic(): 2 is not a valid MCrypt resource in

/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
 tml/time/cancelsubscription/new.php on line 30

 Warning: mcrypt_generic_end(): 2 is not a valid MCrypt resource in

/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
 tml/time/cancelsubscription/new.php on line 31
 decrypted:


 ///


 Regards,

 Purushotham Komaravolu
 Software Engineer
 Yaga, Inc. - advanced payment services
 Direct: 415-901-7343
 Fax: 415-901-1586
 http://www.yaga.com



 - Original Message -
 From: Tech Support [EMAIL PROTECTED]
 To: Purushotham Komaravolu [EMAIL PROTECTED]
 Sent: Tuesday, July 30, 2002 11:34 AM
 Subject: Re: [PHP] mcrypt


  Rather than tease you with hints I'll give you some working code ;-)
 
  Documentation for practical usage of mcrypt is weak. I agree.
 
  ?
  // crypto.inc
  $key = secret key crap;
 
  function hex2bin($data)
  {
  $len = strlen($data);
  return pack(H . $len, $data);
  }
 
  function encrypt($string, $key)
  {
   // version 2.4.x of lib mcrypt
   $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);
   $crypted = mcrypt_generic ($td, $string);
   mcrypt_generic_end ($td);
   return bin2hex($crypted);
  }
 
  function decrypt($string, $key)
  {
   //version 2.4.x of lib mcrypt
   $string = hex2bin($string);
   $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);
   $decrypted = mdecrypt_generic ($td, $string);
   mcrypt_generic_end ($td);
   return trim($decrypted);
  }
  ?
 
 
  usage:
  ?
  include (path/to/crypto.inc);
  $secret = meet at secret place;
  $encrypted = encrypt($secret, $key);
  print original:  . $secret . br;
  print encrypted:  . $encrypted . br;
  $decrypted = decrypt($encrypted, $key);
  print decrypted:  . $decrypted . br;
  ?
 
  Note: if you are encrypting really secret crap like credit card numbers
or
  something of that nature then NEVER include the key anywhere in your
code.
  Make a form where you have to type it in or something in order to
display
  the results.
 
 
  Jim Grill
  Support
  Web-1 Hosting
  http://www.web-1hosting.net
  - Original Message -
  From: Purushotham Komaravolu [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Tuesday, July 30, 2002 12:52 PM
  Subject: [PHP] mcrypt
 
 
  Hello,
I am getting some odd errors trying to get an encrypt/decrypt
  process to
work. Looking at the manual examples and some other literature, I
 have
  tried
the two approaches listed below. For each, I get a
sometimes-works,
sometimes fails result. The manual entry has a string of user
notes
  with
problem like mine, but I still have problems.
 
 
 
Server API Apache
 
 
 
mcrypt
  mcrypt support enabled
  version 2.4.x
  Supported ciphers twofish rijndael-128 rijndael-192
 rijndael-256
saferplus rc2 xtea serpent safer-sk64 safer-sk128 cast-256 loki97
 gost
threeway cast-128 des tripledes enigma arcfour panama wake
  Supported modes ofb cfb nofb cbc ecb stream
 
 
--]
 
 
 
The first attempt used the following code:
 
 
--
?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

[PHP] mcrypt

2002-07-30 Thread Purushotham Komaravolu

Hello, 
  I am getting some odd errors trying to get an encrypt/decrypt process to 
  work. Looking at the manual examples and some other literature, I have tried 
  the two approaches listed below. For each, I get a sometimes-works, 
  sometimes fails result. The manual entry has a string of user notes with 
  problem like mine, but I still have problems. 



  Server API Apache 



  mcrypt 
mcrypt support enabled 
version 2.4.x 
Supported ciphers twofish rijndael-128 rijndael-192 rijndael-256 
  saferplus rc2 xtea serpent safer-sk64 safer-sk128 cast-256 loki97 gost 
  threeway cast-128 des tripledes enigma arcfour panama wake 
Supported modes ofb cfb nofb cbc ecb stream 


  --] 



  The first attempt used the following code: 


  -- 
  ?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); 
  $decrypted_data = mdecrypt_generic ($td, $encrypted_data); 
  mcrypt_generic_end ($td); 


echo key: 
  $keybrinput:$inputbrencrypted:$encrypted_databrdecrypted:$decrypted_da 
  ta; 
  ? 
  --] 


  This resulted, at first, in key: this is a secret key 
  input:Let us meet at 9 o'clock at the secret place. 
  encrypted:\ºþêTÏ'áz(v¹FýaõFËU³æç SäÇÚÖzßù5Qì±_T-:Í 
  decrypted:Let us meet at 9 o'clock at the secret place. 


  BUT after I refreshed/reloaded a couple of times, I got this: Warning: 
  mcrypt_generic_init: Memory allocation error in 
  /home/pndrdrm001/www/administrator/crypt.php on line 64 


  Warning: 1 is not a valid MCrypt resource in 
  /home/pndrdrm001/www/administrator/crypt.php on line 65 


  Warning: 1 is not a valid MCrypt resource in 
  /home/pndrdrm001/www/administrator/crypt.php on line 66 


  Warning: 1 is not a valid MCrypt resource in 
  /home/pndrdrm001/www/administrator/crypt.php on line 67 
  key: this is a secret key 
  input:Let us meet at 9 o'clock at the secret place. 
  encrypted: 
  decrypted:  


  There were no changes to the code. 



  The second try used the following: 


  In file 1, the functions: 
  -- 
  ?php 


   function my_encrypt($sString) 
   { 
GLOBAL $sCryptoKey; 


$iIV = mcrypt_create_iv (mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, 
  MCRYPT_MODE_ECB), MCRYPT_RAND); 


$sEncrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $sCryptoKey, $sString, 
  MCRYPT_MODE_ECB, $iIV); 


return($sEncrypted); 
   } // End function my_encrypt 


   function my_decrypt($sString) 
   { 
GLOBAL $sCryptoKey; 


$iIV = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, 
  MCRYPT_MODE_ECB), MCRYPT_RAND); 


$sDecrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $sCryptoKey, $sString, 
  MCRYPT_MODE_ECB, $iIV); 


return(trim($sDecrypted)); 


   } // End function my_decrypt 
  ? 
  --] 
  and in file 2, the main page: 
  -- 
  ?php 
include cryption.php; 
$sCryptoKey = key; 
$input = test; 
$encrypted = my_encrypt($input); 
$decrypted = my_decrypt($encrypted); 


echo key: 
  $sCryptoKeybrinput:$inputbrencrypted:$encryptedbrdecrypted:$decrypted 
  ; 



  ? 
  --] 


  This resulted in key: key 
  input:test 
  encrypted: foUÝø§ª~RM¡°Kz à¼O¼¿rwx@nÉ 
  decrypted:test  the first time, but then I got Fatal error: generic_init 
  failed in /home/pndrdrm001/www/administrator/cryption.php on line 9 on the 
  second refresh. 



  Is there a missing call to free resources, or something? What can be done? 


  Thanks! 
  Regards,

  Puru

 




Re: [PHP] mcrypt

2002-07-30 Thread Purushotham Komaravolu

Hi,
 Thanks for the prompt answer. But I am still getting the same error.

/
original: meet at secret place
encrypted: d40d72f1b224b9bf86a7dbc52402c1d02a5cf90adb9050f0

Warning: mcrypt_generic_init: Memory allocation error in
/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
tml/time/cancelsubscription/new.php on line 29

Warning: mdecrypt_generic(): 2 is not a valid MCrypt resource in
/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
tml/time/cancelsubscription/new.php on line 30

Warning: mcrypt_generic_end(): 2 is not a valid MCrypt resource in
/mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h
tml/time/cancelsubscription/new.php on line 31
decrypted:


///


Regards,

Purushotham Komaravolu
Software Engineer
Yaga, Inc. - advanced payment services
Direct: 415-901-7343
Fax: 415-901-1586
http://www.yaga.com



- Original Message -
From: Tech Support [EMAIL PROTECTED]
To: Purushotham Komaravolu [EMAIL PROTECTED]
Sent: Tuesday, July 30, 2002 11:34 AM
Subject: Re: [PHP] mcrypt


 Rather than tease you with hints I'll give you some working code ;-)

 Documentation for practical usage of mcrypt is weak. I agree.

 ?
 // crypto.inc
 $key = secret key crap;

 function hex2bin($data)
 {
 $len = strlen($data);
 return pack(H . $len, $data);
 }

 function encrypt($string, $key)
 {
  // version 2.4.x of lib mcrypt
  $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);
  $crypted = mcrypt_generic ($td, $string);
  mcrypt_generic_end ($td);
  return bin2hex($crypted);
 }

 function decrypt($string, $key)
 {
  //version 2.4.x of lib mcrypt
  $string = hex2bin($string);
  $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);
  $decrypted = mdecrypt_generic ($td, $string);
  mcrypt_generic_end ($td);
  return trim($decrypted);
 }
 ?


 usage:
 ?
 include (path/to/crypto.inc);
 $secret = meet at secret place;
 $encrypted = encrypt($secret, $key);
 print original:  . $secret . br;
 print encrypted:  . $encrypted . br;
 $decrypted = decrypt($encrypted, $key);
 print decrypted:  . $decrypted . br;
 ?

 Note: if you are encrypting really secret crap like credit card numbers or
 something of that nature then NEVER include the key anywhere in your code.
 Make a form where you have to type it in or something in order to display
 the results.


 Jim Grill
 Support
 Web-1 Hosting
 http://www.web-1hosting.net
 - Original Message -
 From: Purushotham Komaravolu [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Tuesday, July 30, 2002 12:52 PM
 Subject: [PHP] mcrypt


 Hello,
   I am getting some odd errors trying to get an encrypt/decrypt
 process to
   work. Looking at the manual examples and some other literature, I
have
 tried
   the two approaches listed below. For each, I get a sometimes-works,
   sometimes fails result. The manual entry has a string of user notes
 with
   problem like mine, but I still have problems.



   Server API Apache



   mcrypt
 mcrypt support enabled
 version 2.4.x
 Supported ciphers twofish rijndael-128 rijndael-192
rijndael-256
   saferplus rc2 xtea serpent safer-sk64 safer-sk128 cast-256 loki97
gost
   threeway cast-128 des tripledes enigma arcfour panama wake
 Supported modes ofb cfb nofb cbc ecb stream


   --]



   The first attempt used the following code:


   --
   ?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);
   $decrypted_data = mdecrypt_generic ($td, $encrypted_data);
   mcrypt_generic_end ($td);


 echo key:


$keybrinput:$inputbrencrypted:$encrypted_databrdecrypted:$decrypted_da
   ta;
   ?
   --]


   This resulted, at first, in key: this is a secret key
   input:Let us meet at 9 o'clock at the secret place.
   encrypted:\ºþêTÏ'áz(v¹FýaõFËU³æç SäÇÚÖzßù5Qì±_T-:Í
   decrypted:Let us meet at 9 o'clock at the secret place.


   BUT after I refreshed/reloaded a couple of times, I got this:
 Warning:
   mcrypt_generic_init: Memory allocation error in
   /home/pndrdrm001/www/administrator/crypt.php on line 64


   Warning: 1 is not a valid MCrypt resource in
   /home/pndrdrm001

[PHP] mcrypt

2002-07-16 Thread Peter

Howdy all..
does any one know of another place i can download a win32 ver of mcrypt other than
http://mcrypt.hellug.gr/  ?

as that site crashes my browser when i click any link on the page...

Cheers 

Peter 
the only dumb question is the one that wasn't asked 
 


Re: [PHP] mcrypt

2002-07-16 Thread Danny Shepherd

ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/

- Original Message -
From: Peter [EMAIL PROTECTED]
To: php_gen [EMAIL PROTECTED]
Sent: Wednesday, July 17, 2002 1:16 AM
Subject: [PHP] mcrypt


 Howdy all..
 does any one know of another place i can download a win32 ver of mcrypt
other than
 http://mcrypt.hellug.gr/  ?

 as that site crashes my browser when i click any link on the page...

 Cheers

 Peter
 the only dumb question is the one that wasn't asked



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] MCRYPT anybody anybody???

2002-07-01 Thread charlesk

Does anybody know anything about mcrypt for windows???

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] MCRYPT anybody anybody???

2002-07-01 Thread Jason Wong

On Monday 01 July 2002 23:09, charlesk  wrote:
 Does anybody know anything about mcrypt for windows???

http://homepages.tesco.net/~J.deBoynePollard/FGA/questions-with-yes-or-no-answers.html

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Then there was the Formosan bartender named Taiwan-On.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mcrypt again...

2002-07-01 Thread charlesk

Where can I get mcrypt for windows and php 4.2.1?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] mcrypt

2002-06-29 Thread charlesk

Has anyone got a working mcrypt.dll for php 4.2.1 and Windows 2000 Server?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Mcrypt Function - New to it

2002-05-30 Thread Tom Ray

Hi there..some what a new programmer when it comes to all this. I'm 
trying to encrypt some data and then decrypt it. It doesn't have to be 
high bit encryption just something simple like 3DES. But I keep getting 
it wrong. Any help would be greatful. Here's the piece of code:

$iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_3DES, 
MCRYPT_MODE_ECB), MCRYPT_RAND);  

$key = md5(Secret Key);
$sample2 = Hello;

$lockdata = mcrypt_encrypt (MCRYPT_3DES, $key, $sample2, 
MCRYPT_MODE_ECB, $iv);

echo $lockdata\n;

$text = mcrypt_decrypt (MCRYPT_3DES, $key, $lockdata, MCRPYT_MODE_ECB, 
$iv);  

echo $text\n;





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Mcrypt Function - New to it

2002-05-30 Thread Tom Rogers

Hi
Here are a couple of functions that should help to get you started, iv is 
set to all 0's so it does not have to be passed around or stored in 
sessions. It is base64 encoded so it can be stored or passed to the browser.

Function Code_id($id,$password){
 $eid = 0;
 $td = mcrypt_module_open (MCRYPT_TripleDES, , MCRYPT_MODE_ECB, );
 $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv);
 mcrypt_generic_init ($td, $password, $iv);
 $eid = base64_encode(mcrypt_generic ($td, $id));
 mcrypt_generic_end ($td);
   return $eid;
}
Function Get_id($eid,$password){
 $id = 0;
 $td = mcrypt_module_open (MCRYPT_TripleDES, , MCRYPT_MODE_ECB, );
 $iv = pack(a.mcrypt_enc_get_iv_size($td),$iv);
 mcrypt_generic_init ($td, $password, $iv);
 $id = mdecrypt_generic ($td, base64_decode($eid));
 mcrypt_generic_end ($td);
 return $id;
}
Tom


At 11:07 PM 30/05/2002 -0400, Tom Ray wrote:
Hi there..some what a new programmer when it comes to all this. I'm trying 
to encrypt some data and then decrypt it. It doesn't have to be high bit 
encryption just something simple like 3DES. But I keep getting it wrong. 
Any help would be greatful. Here's the piece of code:

$iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_3DES, MCRYPT_MODE_ECB), 
MCRYPT_RAND);

$key = md5(Secret Key);
$sample2 = Hello;

$lockdata = mcrypt_encrypt (MCRYPT_3DES, $key, $sample2, MCRYPT_MODE_ECB, 
$iv);

echo $lockdata\n;

$text = mcrypt_decrypt (MCRYPT_3DES, $key, $lockdata, MCRPYT_MODE_ECB, 
$iv);

echo $text\n;





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




  1   2   >