faqts : Computers : Programming : Languages : PHP : Common Problems : Forms and User Input

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

19 of 38 people (50%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

What should be used to pass encrypted data back and forth?
How to post data to port 443 (SSL) with PHP socket ?
I am using mcrypt library to encrypt the data. I want to pass the encrypted data in url. The problem

Feb 26th, 2007 05:03
Husen Mankada, Mark, Nathan Wallace, Gary Chen, Sascha Schumann


How to convert hexadecimal format back to binary format? Is there any
other way to encrypt the binary data, convert them to text to pass in
url and receive the original encrypted script in other page so that it
can be decrypted?
Thanks in advance.
http://www.php.net/manual/ref.mcrypt.php3
The mcrypt functions spit out binary data, you can run them
through bin2hex() to convert them to an ASCII representation.
http://www.php.net/manual/function.bin2hex.php3
Alternatively, if you simply want to pass them through URLs, you
may need to urlencode() them first.
http://www.php.net/manual/function.urlencode.php3
--
then again, if you mean encrypted as in secure, you should use a SSL 
(secure sockets layer). Try calling the url of the page with the 
https://site/page format (note the https:// vs. http://). Ask your local 
administrator for SSL help if needed.
-mark