hello, I'm working on a personal project and I was looking for some help. I am writing a program that needs to store user profiles in an external file (.user_data.dat). Problem is that anyone with half a brain can find the file and with any text editor look at the file and see everyone's profile information (login names, passwords, etc.). Since I still need to be able to read/write to this file with my program, I can't just restrict read/write permissions to it since I don't want the user to keep entering their sudo password (btw. I'm using gcc on linux) anytime they save their profile.
I don't know what code to provide since I don't know where to start, but if you need more information I'll happily provide.
I suppose I could always just convert the data inside the file to something like their ASCII equivalent or something that would just make it more annoying to decypher for the spying individual, but I feel as though there is a better way (probably very obvious). I also should mention that I need to maintain formatting inside the file (at least in this version) in order for it to be properly read, but I'm thinking that eventually that'll need to/will change.