Monkuar Posted April 7, 2012 Share Posted April 7, 2012 I was looking at this snake like game for jquery http://jquery-snakey.googlecode.com/svn/trunk/index.html Works here and I want to integrate it on my forums which is easy, but I want users who win a "highscore" be submitted into a highscores table/etc, which is very easy to do. Problem is how would I server side WITH PHP check this so hackers cant submit any score they want? +they can view source code of the js game.. are games like this just not possible to 100% secure them over? hackers will always beable to hack em huh? Quote Link to comment https://forums.phpfreaks.com/topic/260501-how-to-secure-data/ Share on other sites More sharing options...
scootstah Posted April 7, 2012 Share Posted April 7, 2012 You could probably encrypt the POST data, and obfuscate the Javascript. It's still beatable but it's better than plaintext. Quote Link to comment https://forums.phpfreaks.com/topic/260501-how-to-secure-data/#findComment-1335180 Share on other sites More sharing options...
Monkuar Posted April 7, 2012 Author Share Posted April 7, 2012 You could probably encrypt the POST data, and obfuscate the Javascript. It's still beatable but it's better than plaintext. ok from my snake.swf game i decompiled it and made it $post the variables are: echo '&success=1'; $score = $_POST['score']; $game = $_POST['game']; $db->query('UPDATE users set notes="'.$score.'|'.$game.'" where id = 2 ') or error('Unable to update user', __FILE__, __LINE__, $db->error()); the score is what is coming from the .swf everything is working.. but this is way to unsafe.. somone could just pass w/e they want.. lol does encrpytion function work with actionscript also ? wouldn't somone just beable to encrypt there own score and do it? lol this shit is so hackable Quote Link to comment https://forums.phpfreaks.com/topic/260501-how-to-secure-data/#findComment-1335183 Share on other sites More sharing options...
viviosoft Posted April 7, 2012 Share Posted April 7, 2012 You could try passing the values using jQuery (AJAX). That way the data isn't being seen by the end-user in the address bar. http://api.jquery.com/jQuery.ajax/ The some.php would handle your database inserting. You would "get" the score and game values from hidden fields on the form. Hope this helps. This is not the place to discuss jQuery or Ajax so I can't go into great detail. There's quite a bit of information out there about how to pass data using jQuery and Ajax. I've sure this will get you started in the right direction. $.ajax({ type: "POST", url: "some.php", data: "score=100&game=4" }).done(function( msg ) { alert( "Data Saved: " + msg ); }); Quote Link to comment https://forums.phpfreaks.com/topic/260501-how-to-secure-data/#findComment-1335194 Share on other sites More sharing options...
scootstah Posted April 7, 2012 Share Posted April 7, 2012 does encrpytion function work with actionscript also ? wouldn't somone just beable to encrypt there own score and do it? lol I'm confused. You said the game was for jQuery, but ActionScript is Flash. Is the game written in Javascript or Actionscript? Either way, they wouldn't be able to encrypt their own values because they wouldn't have the encryption key. Quote Link to comment https://forums.phpfreaks.com/topic/260501-how-to-secure-data/#findComment-1335201 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.