Jump to content

Passing sensitive information using GET or POST


mattd55

Recommended Posts

Hey folks, kind of a PHP newbie.  Basically, we have two websites which I need to pass information securely from one to the other.  It is basically, login parameters and then conduct a search.  I do not need to create a web service or any type of middleware solution at this time, I just need a quick and secure method of passing username/pass and the search parameters.  I read a nice article (although old) that stated I could pass the data as follows, in either a cookie or a form variable.

 

$encrypteddata = mcrypt_ecb(MCRYPT_TripleDES, "Secret key", serialize($data), MCRYPT_ENCRYPT);

$encrypteddata = bin2hex($encrypteddata);

 

$encrypteddata = hex2bin($encrypteddata);

$data = unserialize(mcrypt_ecb(MCRYPT_TripleDES, "Secret key”,$encrypteddata, MCRYPT_DECRYPT));

 

(And yes, I do realize the mcrypt_ecb function is depreciated)

 

However, I believe that with this solution, if I pass it in the URL, I could potentially use up the 2,000+ character limit.

 

My question is, is there a better way to do this?  Or different approach I could use?  Thanks in advance.  Great board!

Link to comment
Share on other sites

No limit on POST.  I used cURL with POST with great success.  I was thinking about the flow of data incorrectly.  The solutions was to simply supply a link with some search params to my php script, i cURL a static link with those search param and voila, a POST is generated and returned with I need the data I need!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.