I am working on a simple game. It will have multiplayer over LAN, and I want to give the host the option to verify that players are not using modified clients (note that this will be disabled by default; this is more of a coding exercise). Both the client and host are identical.
Here's what I have so far:
1.) The host generates a random key.
2.) The host takes this key, combines it with the host IP address, and uses it to salt an MD5 hash of the important game files.
3.) The host then takes the generated key, and sends it in a packet to the client.
4.) The client takes this key, combines it the originating IP address of the packet, and uses it to salt an MD5 hash of the important game files.
5.) The client takes the hash and sends it back to the host.
6.) The host then checks the hash it receives from the client against the hash it generated. If they are unequal, it drops the connection.
Is this sufficient to deter most client modifications? I get that this check can be circumvented by using an unmodified client to generate the hash and sending it with a modified client; is there any way to prevent this?