Jump to content
  • Advertisement
Sign in to follow this  
ForeverNoobie

File signatures

This topic is 3857 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
You can generate an MD5 hash from the contents of the file. Then at run-time, re-verify that the hash of the file in question still matches.

Share this post


Link to post
Share on other sites
Quote:
If I wanted my game to have a file that the user couldn't tamper with


Sorry, doesn't work that way. If it's on the user's hard disk, they can change it.

Of course, you can make it *extremely difficult* for them to tamper with it *in a way that actually does anything useful*. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by taby
You can generate an MD5 hash from the contents of the file. Then at run-time, re-verify that the hash of the file in question still matches.


Ok but say the game has to modify the file. It would have to save the new hash to users comp so it would be easy for him/her to find right?

Share this post


Link to post
Share on other sites
Sure. As has been said, you cannot prevent this, only discourage it. You have to evaluate the cost/benefit ratio and decide if its really worth it. Why don't you want users to modify this file? What's in it?

If you're doing it just because "you don't want them to steal your data," for example, don't bother. They can still steal if they want to (although chances are it's not nearly as interesting to them as it is to you) so you'll just be wasting your time. If you're doing it for security/anti-cheat in some kind of networked game, then you've already failed by trusting the client (assuming client/server) so don't bother. Et cetera.

There are some valid reasons to want to guard against tampering, but hobbyists don't often need to concern themselves with them. So I repeat, why do you want to do this?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!