7

I recently developed an online multiplayer game and it's working fine. There's a central server handling TCP connections with clients, and they both receive and send data.
Is there a way to verify that the data sent hasn't been modified before the receiver reads it?
Does a TCP connection handle it in some way? If not what is the best way (not asking for code) to implement it?
By now I came up with those ideas:

  • Modify the data sent adding some sort of verify-value, such the packet length.
  • When a packet is received, ask the server to send it again and verify if they are equal.

I searched for a common used solution but couldn't find much.
Encryption should be my last option.

Edit
For a simple way to achieve this:

  1. MD5
  2. SHA1
  3. SSL
Community
  • 1
  • 1
mastaH
  • 1,234
  • 3
  • 15
  • 30

1 Answers1

6

Agreed with Bart, you may want to look at using a Hash method for data verification.

BenSchro10
  • 326
  • 1
  • 7