-
Password Protect
How would you make a password protected program, simply. I know how to use strings and if statements with strings but I dont know how to make files that are used outside of a compiler so how could you protect it so that nobody could access by just reading the source code?
-
Save the password to an outside file, but first convert the password to binary or some kind of hash to protect it. Then when the program checks, it converts the user entered password to binary or some kind of hash and then checks that encoded password to the stored password(which is also encoded). This way you are always dealing with encoded passwords, not plain text ones.
-
sounds good i just wish i understood
-
1: Make the program read a binary or hash formatted file.
2: Encode entered password.
3: Compare now encoded password with already encoded file text.
4: If comparison returns false, deny access.
(Same thing jmd15 just said.)
What don't you understand?
The whole thing?
If so, you need to get more experience before trying to do what you want to do.
BTW: Once someone has access to your source code, there is NO WAY to protect anything that your program does or has, because all they need do is decode the encrypted file the same way you do to see that password. So as I just said, you can't make your password safe, if someone has access to your source code.
- Hope I could be of some help! -
-
What don't you understand?
-
Just use fstream for writing/reading the saved file and use XOR for the encryption/decryption for the password.