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