Protect file with password

Hi can someone tell me how to protect a .txt file with a password.
For example the user tries to open test.txt and the C++ program(running all the time) gives you a pop up window where you have to enter the correct password.
Is there a way by which you are able to do that.

Thanks!
One of the easiest methods would be to read file, then enrypt it and put it back to file. Then it would be unreadable. And when you want to read it just decrypt it. Use a password as seed.
Can you procide me with some code, thanks!
Topic archived. No new replies allowed.