By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,043 Members | 1,179 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,043 IT Pros & Developers. It's quick & easy.

mcrypt not working

P: n/a
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! :)
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Matt McKay:
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.


"Doesn't work" isn't really helpful :) Do you actually have support for the
mcrypt library in your PHP?

André Nęss
Jul 17 '05 #2

P: n/a

"Matt McKay" <so*****@microsoft.com> wrote in message
news:D4********************@news-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
Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.