"Matt McKay" <so*****@micros oft.com> wrote in message
news:D4******** ************@ne ws-server.bigpond. net.au...
I've written a php page which allows users to type in a text string and a
key, then choose from a dropdown menu of encryption/decryption cyphers,
and a method (encrypt, decrypt).
The whole thing works, except the mcrypt command doesn't work.
here is my mcrypt command:
if ($method == 0) {
//Encrypt
$output = mcrypt_ecb ($algorithm, $key, $input, MCRYPT_ENCRYPT) ;
} else {
//Decrypt
$output = mcrypt_ecb ($algorithm, $key, $input, MCRYPT_DECRYPT) ;
}
Here's a list of what the variables may be:
$algorithm = MCRYPT_3DES
$key = "plain text"
$input = "more plain text"
if you want, I can upload a .txt containing the whole php file.
Thanks! :)
You need to let us know what you mean by "doesn't work"...
Either way - its been a while since I used the mcrypt functions, but when I
did, there were a few things I should (but hadn't done) and a newsposter
here guided me:
1 - Have you installed the mcrypt *development* library? Note, I had
installed libmcrypt on my box - I had *incorrectly* believed that the
development version of libmcrypt was sorta like an alpha or beta release -
It wasn't... Because I was programming, the development version has the
libraries that PHP would use when being compiled... Which leads me to my
last question...
2 - You did compile PHP with --with-mcrypt didn't you?
Hope that helps... its from memory but I believe it to be correct...
randelld