I'm currently designing a basic Java program that uses sockets to communicate from a server to multiple clients. I want the clients to be unmodified, however, to prevent against users trying to use the software not how it was intended. I'm considering using an MD5 checksum and sending it to the server to compare it with what the checksum should be, but a modified client could simply send an incorrect checksum to fake the server into thinking that the client is untouched.

To put it simply, how would I go about verifying a client in such a way, that a modified client cannot fake being unmodified?

  • Might be better for stack overflow as it's really a programming question. – ztk Jul 9 '15 at 21:22
  • Okay, I figured it was more of a security question so I posted it here. I'll try Stack Overflow though, thanks! – Eli Jul 9 '15 at 21:40
  • 1
    Clearly this is possible since software such as Microsoft Windows can do this. However, I don't know that it is very simple! You would have to have a checksum mechanism that couldn't be spoofed, maybe something with a complex time base. You might also need to invalidate the client often so that users have to download new versions with new checksum models. You might want to try and identify specific PARTS of your code that required protection rather than all of it. – Julian Knight Jul 9 '15 at 22:02
  • @JulianKnight The invalidation idea seems like it could work, but it would be too annoying for the user. Instead, what if the software constantly invalidated itself, followed by updating itself automatically. Would that be a good and feasible idea? – Eli Jul 9 '15 at 23:35
  • That sounds feasible. Same principle but automated. – Julian Knight Jul 10 '15 at 0:07

IF what you ask was possible, THEN there would be no software or video piracy whatsoever. You could have some playing software that simply plays the movie but refuses to dump the data in a file, and that playing software would "prove" its unmodified status to the server, thus allowing the download.

This tells us that what you seek must be hard and would be worth an awful lot of money if it was ever invented. There also are good theoretical reasons why it is actually impossible, which would explain why nobody found such a way to reliably validate software remotely. The bottom-line is that you cannot ensure integrity of anything that runs on the attacker's own machine.

Now, if you have some high level of control on the target hardware, then things become possible. This is the security model of existing game consoles: the firmware and all games are under strict control of the publishers; no new software enters a console if it has not been digitally signed by an allowed publisher. Mere users cannot simply program their console. This is still hard to do properly -- console firmware, like any software, has bugs and thus all this signature-based shielding might be worked around occasionally -- but at least it can theoretically work.

But for a PC, forget it.


Working it out in the comments with @JulianKnight, we decided that invalidation and updating would be the best way to go about accomplishing this.

To be more specific; the server invalidates the client frequently (but not enough to cause stress on the host machine), and the client must update itself each time it is invalidated in order to get a new md5sum hash that is valid with the server. Using this method makes it so that if anybody modifies the client, they must constantly update their code to new clients, making modifications too bothersome to continue doing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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