In my game/app (iPhone) the client side sends http requests (get or post) to the game http server. Requests have this form:
gameserver.com/userId/givebonus/100
This for example would give the userId a bonus of 100.
Now, we encrypt the server request and it will become something like:
gameserver.com/42c34c234c234/ghjghjg4hj32g42jh2/424j23gh4h234h2j34j23
I'm not to fuss about some hacker trying to decrypt this to unveil the meaning of all of this, what I'm worried about is sniffing. Cos once the hacker knows that:
gameserver.com/42c34c234c234/ghjghjg4hj32g42jh2/424j23gh4h234h2j34j23
Gives a bonus of +100 it could just keep sending the same request over and over again.
So how do you prevent this?
Talking with few friends these are the possible solutions, but none of them would be either easy to implement or more secure:
- Moving all (most) of the logic server side.
- Handshake the first request and respond only to that mac address. (This won't work I think)
- Changing private encryption key dynamically? How?
- Encrypt the whole requests, basically using https? (Dont know how though :( )
I'm sure there's an easier answer I dont see :P