If you save it as a .txt file, even though you could encrypt it, the User Would still be able to change it, just not make much sense out of it. I assume that you wanted to encrypt it just to make it unchangable, But if not, there should be some encryption methods available. Easiest Would probably be to search online for Java Encryption methods, or to just add +1 in each Char of the String of your file, which Would also work, But be a very Weak encryption. But if it’s only to avoid fast changes to the file, then that could also Suffice.