Do you guys know of any way that I could go about protecting my properties
file so that only my program can alter it? I wouldn't want someone to be able to read the properties
file either if it was possible.
You are asking a question in terms of absolutes, and there is no absolute way to do it. If your program can read and modify your file, then there must be a way for some other program or person to do it too.
File permissions may help, but can you trust the root or admin user?
Even if the permissions are right, can you trust other programs that run as your username?
Encrypting the file will make it more difficult for someone to read the file, but not to corrupt it. And a 'determined' person with access to your program will be able to find the decryption key (otherwise you could not read it yourself).
Bottom line is that you need to ask yourself "what reasonable steps can I take to make it not worth trying to access/read/change the file?"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With