I’m making a ‘Pokémon Storage System’ with a Client/Server model and as part of that I was thinking of storing an inventory file on the users computer which I do not wish to be edited except by my program. An alternative to this would be to instead to store the inventory file on the server and control it’s editing by sending commands to the server but I was wondering if there are any situations which require files to be stored on a users computer where editing would be undesirable and if so how do you protect the files? I was thinking AES with some sort of checksum?
1
Logically it’s impossible – if the clients computer has all the information to edit the inventory then it has all the information necessary to edit the inventory.
You can make it harder by encrypting the data and hiding the key inside your program, storing parts of the key in different places and calculating parts based on some maths is popular. But ultimatly it depends on how much time/effort they are going to put into it. If this is just a kids game then simple encryption will do – if you are doing online gambling for big $$$ then it won’t!
3
I was thinking AES with some sort of checksum?
No. If someone de-complies your Software they will get the Key and be able to modify the Check Sum. The ONLY way to secure this data from being modified is store it on your server.
If you install on a Computer you don’t have control of, assume the Computers owner has access to ALL the installed source code (and can modify it).
1
It’s a hacking race you can’t win, but you can make the contest interesting by signing and/or encrypting the data. If there’s a remote server involved, the remote can do the signing and verifying.
Also, consider that you need to prevent other things than fabrication or alteration – “good” inventory files might be shared (or sold), stored and reused, or many other creative kinds of abuse.
Remember that the weakest link is the one that will be attacked. If your signing and verifying methods are good enough, the hackers will just target the decrypted/unsigned form of the data that has to exist in order for it to be used.
1