Jump to content

How to secure data?


Monkuar

Recommended Posts

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? :P  +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?

Link to comment
https://forums.phpfreaks.com/topic/260501-how-to-secure-data/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/260501-how-to-secure-data/#findComment-1335183
Share on other sites

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 );

});

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/260501-how-to-secure-data/#findComment-1335194
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/260501-how-to-secure-data/#findComment-1335201
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.