Jump to content

general request security


Rifts
Go to solution Solved by requinix,

Recommended Posts

What is the best method to prevent unauthorized requests being sent to your server? For example I have an ios game which sends a users name and score to my php server. Whats preventing someone from just sniffing the traffic and seeing the simple request to: 

http://mywebsite.com/addscore.php?name=jimmy&score=100

now cant anyone just copy paste that url and change that values to anything "cheat" the game?

 

All I can think to do is send a key with the url and check the key is correct, but if someone is sniffing the url they can see they key and its pointless anyway? 

 

what am i missing?

Edited by Rifts
Link to comment
Share on other sites

  • Solution

You can't prevent someone from listening to requests and faking their own. It's just not possible.

 

The best thing you can do is rely on them being unable to read the game's code. Which isn't true, but it's harder than simply sniffing traffic. For example, you can hash some private key with the name and score (known as request signing) and get something like

http://www.example.com/addscore.php?name=jimmy&score=100&signature=1234567890abcdef
addscore.php calculates and verifies the signature before recording the score.
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.