Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am currently building an iOS MMO and I'm leaning towards using TCP as my networking protocol over the higher level HTTP (for the speed difference and the fact that it does not require the client to poll constantly for updates.)

Now, through my research I know that with MMO and any client-server multiplayer games, you should never trust what the client sends to the server. As an extension of that, you wouldn't want anybody to read your packets to see the contents so it's harder for them to send correctly formatted data to the server. (Maybe I'm paranoid.)

The only problem is, where in HTTP there is great support for a secure channel in HTTPS through SSL where the setup occurs mainly server-side, I am not aware of a way to achieve the same thing on TCP. Is there any resource I could be referred that could help me achieving similar security, or at least good enough, on both the iOS side and server-side?

On a side note, if the answer involves doing the encryption and decryption on the client-side, would that severely impact the performance of my application?

Thanks!

share|improve this question
1  
All encryption and decryption done client side can be reverse engineered by someone wanting to build their own client, and will add some extra latency. I wouldn't bother with it. –  Adam Jan 5 '12 at 12:21
    
@Adam thanks for the advice. That does make sense. I will probably not bother with encryption and only do secure connections during authentication then. –  Jamornh Jan 5 '12 at 14:46
1  
Encryption is to prevent a 3rd party listening in on the communication, it has no point if the aim here is to prevent your legitimate users being naughty. –  Eren Güven May 11 '13 at 13:26

1 Answer 1

up vote 2 down vote accepted

If you are looking to prevent people from modifying the client, the short answer is, you can't. Seeing that you plan on making a turn based game it doesn't really matter, you just have to make sure that the client doesn't get any information that the user is not supposed to get, and that the server disregard any illegal action.

Still, you could use an encrypted channel to protect the user, but that is a feature you can always tag on, there should be some security libraries that make this pretty easy.

share|improve this answer
    
Thanks for your answer. So if I understand correctly, I shouldn't bother with encryption or decryption to protect the data as it can always be cracked. The only reason I should do a secure connection would be to protect the user's username and passwords and maybe private data from being stolen. Thus, through the majority of the game time, I don't have to bother with it other than at authentication? –  Jamornh Jan 5 '12 at 14:45
1  
That would be sensible. After all, it is just a game, and simply knowing other peoples game data isn't really interesting. –  eBusiness Jan 5 '12 at 15:15
    
You can check for modified clients by checking the Checksum of each file. If The checksum is not the same as the checksum of the file you produced, the file must be modified. This is done by some games I know. –  Thomas Jan 7 '12 at 16:46
1  
@Thomas And if you are into modifying executables anyway you can modify the checking part to simply send the desired checksums regardless of the actual files. You can turn this into an arms race, but if the game relies on any skill that a computer can do better than a human there is always going to be a way of cheating. –  eBusiness Jan 7 '12 at 20:02
    
I'm sure anything will be "hackable", it's just about making it as difficult as possible or as time consuming as possible. –  Thomas Jan 8 '12 at 11:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.