I want to be able to create a file, distribute it to an end-user, but prevent them from making modifications to the file.
Now, obviously, I can't actually stop anybody from modifying the file - so my approach is to detect and reject the file if it's modified.
My intention is to generate a salted hash of the file contents and append it to the file. On reading, the hash is verified before reading the rest of the file. The downside of this is that I have to distribute the fixed "salt" in the executable which reads the file. Obviously I can obfuscate it to some extent, but that still feels like a weak link.
Are there any better approaches to solving this kind of problem?