l!m!t Posted February 7, 2009 Share Posted February 7, 2009 Hello everyone, I am stuck on something hopefully someone can provide some quick help. I have an array that I have converted to $_GET vars, since I was unable to register it as a session. I want to encrypt the $url output, base_64 seems to easy to decrypt. I have mcrypt on my server, but am lost on how to decrypt the $_GET vars back into an array. Can anyone provide a simple method to do this or an example, I basally only want to decrypt the encrypted vars and put them back into an array. I am not sure if mcrypt is even a solution. Any exaples or help would be great. This is my code. $comments_admin_array=array( 'Test1' => $_REQUEST['Test1'], 'Test2' => $_REQUEST['Test2'], 'Test3' => $_REQUEST['Test3']); $url = ""; foreach($comments_admin_array as $key => $value){ if($url != ""){ $url .= "&"; } $url .= $key . "=" . $value; } ?> http://myurl.com?qd=<?=$url?> // want to encrypt $url Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/144247-solved-url-encryption/ Share on other sites More sharing options...
crashmaster Posted February 7, 2009 Share Posted February 7, 2009 $url = urlencode($url); ? Quote Link to comment https://forums.phpfreaks.com/topic/144247-solved-url-encryption/#findComment-756998 Share on other sites More sharing options...
crashmaster Posted February 7, 2009 Share Posted February 7, 2009 $url = urlencode($url); ? Why dont you use $_POST ?? Quote Link to comment https://forums.phpfreaks.com/topic/144247-solved-url-encryption/#findComment-756999 Share on other sites More sharing options...
genericnumber1 Posted February 7, 2009 Share Posted February 7, 2009 Any encryption scheme that you are capable of decrypting is easy for someone else to decrypt. You can do something like serialize/base64/gzcompress, but it's still not secure. If you're going to be passing sensitive data, do it through POST, not GET. If it's not sensitive, what's wrong with a simple solution like base64? Quote Link to comment https://forums.phpfreaks.com/topic/144247-solved-url-encryption/#findComment-757003 Share on other sites More sharing options...
l!m!t Posted February 7, 2009 Author Share Posted February 7, 2009 I think I will try a POST method, but wouldn't a post method then require it to be submitted as a form ? It would still make the Variables (values) viewable by source or am I wrong? Quote Link to comment https://forums.phpfreaks.com/topic/144247-solved-url-encryption/#findComment-757025 Share on other sites More sharing options...
PFMaBiSmAd Posted February 7, 2009 Share Posted February 7, 2009 Since the original data is $_REQUEST (POST/GET/COOKIE) from the visitor anyway, there is no point in trying to encode/encrypt it for security reasons it because he was the source of it in the first place. You should really just figure out what was wrong with your code using sessions because the more data you pass through the browser as POST/GET/COOKIE data, the slower your site will operate. Quote Link to comment https://forums.phpfreaks.com/topic/144247-solved-url-encryption/#findComment-757043 Share on other sites More sharing options...
l!m!t Posted February 7, 2009 Author Share Posted February 7, 2009 Since the original data is $_REQUEST (POST/GET/COOKIE) from the visitor anyway, there is no point in trying to encode/encrypt it for security reasons it because he was the source of it in the first place. You should really just figure out what was wrong with your code using sessions because the more data you pass through the browser as POST/GET/COOKIE data, the slower your site will operate. Ah ok. Thanks, yeah this is the default action from the callback server, they send these $_REQUEST variables anyway. I think since the Callback is offsite is the reason my session doesn't register the variables. This is why I was using $_GET to processes them. Maybe a simple base_64 will work for my needs I was just hoping for something a little more encrypted. Thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/144247-solved-url-encryption/#findComment-757054 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.