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

Translating PHP mcrypt to exec

P: n/a
Hello, My hosting company does not support the PHP mcrypt functions.
Instead, they recomend using the command line, /usr/local/bin/mcrypt
utility via PHP's exec method. Sadly, they do not provide any
documentation how to do this. How would i translate the following

function encryptString($p_str)
{
$iv_size = mcrypt_get_iv_size(MCRYPT_XTEA,
MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);

$enc = mcrypt_encrypt(MCRYPT_XTEA,
ENCRYPTION_KEY, $p_str, MCRYPT_MODE_ECB, $iv);
return $enc;
} // encryptstring
to run via an exec command, returning the encrypted output to some PHP
variable?

I'm using PHP 4 on Linux if that's useful. Thanks, - Dave

Aug 24 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
la***********@zipmail.com wrote:
Hello, My hosting company does not support the PHP mcrypt functions.
Instead, they recomend using the command line, /usr/local/bin/mcrypt
utility via PHP's exec method. Sadly, they do not provide any
documentation how to do this.


You can usually find the man pages for UNIX stuff by via Google by
searching for the name and the word "man".
This may help you:

http://www.strw.leidenuniv.nl/cgi-bi...rypt&section=1

Brian
Aug 24 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.