Connecting Tech Pros Worldwide Forums | Help | Site Map

Translating PHP mcrypt to exec

laredotornado@zipmail.com
Guest
 
Posts: n/a
#1: Aug 24 '05
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


Default User
Guest
 
Posts: n/a
#2: Aug 24 '05

re: Translating PHP mcrypt to exec


laredotornado@zipmail.com wrote:
[color=blue]
> 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.[/color]

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
Closed Thread