I want to refer a file for some information like the last time the user had used the program and etc. But I can't just use textfiles because the user may edit it, or even worse delete it.

So is there a way to refer an external file that the user cannot access by clicking, outside the program? Better yet if the file is invisible like a .ini file or something.

This is possible right?

And also what if I want more protection, what is the best way to encrypt that file?