I’m writing a program that asks the user for a username and password. I also want to be able to save this information if they so choose, but I don’t want to have my program create a simple plain text file that anyone can open. How can I have my c++ program write to an encrypted file and be able to access it when the program is launched later?
Share
Try libgcrypt. For this sort of task, the key (generated from the user’s password), will have to be entered every time. You don’t want to save the key right next to the encrypted data.
You could also try some scripting with pgp or gpg, if you want to tackle it at a higher level.