473,405 Members | 2,262 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Translating PHP mcrypt to exec

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
1 2098
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt McKay | last post by:
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...
3
by: Marek Muszak | last post by:
Hello, I try use mcrypt but I want to use key in bytes, not in string. Encrypt text will be decrypt in Delphi with function where key is 16byte not string. How can I do this. Thanks for any...
1
by: BKDotCom | last post by:
I'm writing an app that will use blowfish encryption.. PHP's mcrypt will be used if available. if not, I'll use PHPmyadmin's blowfish.php library. The problem is I can't figure out what...
4
by: believein | last post by:
Hi all, I installed PHP thru the XAMPP package on my windows machine. The problem, I couldn't solve, is that the mcryppt funcs don't work. It return the following message: Call to undefined...
2
by: nihaopaul | last post by:
hi everyone, i'm having a hard time with trying to guess how to do this in PHP, basically i was given a simple program to use but it'd mean running exec from php, with php being advanced enough i...
5
by: sylvian stone | last post by:
Hi, I'm getting some strange errors that I cannot pin down: Warning: mcrypt_generic_init(): Iv size incorrect; supplied length: 7, needed: 8 in...... This is strange because the data is...
0
by: codearcher | last post by:
I have the latest version of XAMPP installed on Windows XP Pro SP2. I am trying to use mcrypt with rijnndael-128 on ecb: " $cr = mcrypt_module_open('rijndael-128','','ecb','') or...
0
by: E. Recio | last post by:
Long story short. I want to use Mac OS/X and PHP. I have a db with passwords stored under Linux using the crypt("foo", "$1$".$salt."$); scheme. This means that crypt should execute a CRYPT_MD5...
3
by: =?UTF-8?Q?Ahmad_=E3=8B=A1_Baitalmal?= | last post by:
Hi, I'm having a hard time getting python-mcrypt extension to build. I installed libmcrypt with --prefix=/usr and I checked that the library exists -rwxr-xr-x 1 root wheel 352K Sep 19...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.