Re: mcrypt_encrypt help needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 30, 2011, at 5:13 PM, Matijn Woudt wrote:


Your decrypt function seems fine, and the encrypt/decrypt functions
work fine both in the same file for me. Now you say you use
$_GET["myval"], which means you get them from URL. Base64 is not URL
safe, have you used urlencode()?

Matijn



OK, the problem appears to be that my string encoded contains a + symbol:

Sw+ht0agaQRBpFlfHSucpYZ....

So I rawurlencode it and if I echo it out, it appears correctly on the page as:

Sw%2Bht0agaQRBpFlfHSucpYZ ....

BUT... when I pass this encrypted value off to PayPal (I'm integrating with them), encoded, when they return me to my site, instead of passing me my value as above, they are somehow decoding back to the original:

Sw+ht0agaQRBpFlfHSucpYZ....

As I can see it in the URL. The + symbol is then interpretted as a space instead of + symbol and a result, my decrypt function fails.

So I send off the encrypted value encoded to PayPal but when they go to redirect back to my site after payment has been made, instead of the url with Sw%2Bht0agaQRBpFlfHSucpYZ .... in it, they are decoding it so my url contains Sw+ht0agaQRBpFlfHSucpYZ.... which causes me problems.

Is there alternative encrypting scheme that will not need url encoding (so I can be sure the passed url back from PayPal is ok as is)?

--Rick



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux