I_Need_Money
Limp Gawd
- Joined
- Jan 24, 2004
- Messages
- 159
Does anyone here know how most programs out there manage non-hardcoded passwords? This is something I've been thinking about a lot recently but can't figure out. By non-hardcoded I mean that the program doesn't employ a strategy like this (pseudocode):
For instance, I use a program called cryptext which allows you to encrypt a file by right-clicking on it and choosing the "encrypt" option from the context menu. When you select "encrypt" the program prompts you for a password and, if the password is correct, encrypts the file. It also allows you to change your password at any time.
How does it do this? It can't just be storing a password in some text file somewhere since that would make it too easy for others to find your password. And it can't be using some hard-coded password since it allows you to change your password at any time.
The main reason I ask is not just because I'm curious but because I'd like to have some kind of password system in a program that I'm writing. If it's too complicated then is there at least a free library out there that I can use (preferably in C/C++)?
Code:
get_user_input(pwd)
if pwd != "blahblah"
print "incorrect password"
exit
else
do stuff
How does it do this? It can't just be storing a password in some text file somewhere since that would make it too easy for others to find your password. And it can't be using some hard-coded password since it allows you to change your password at any time.
The main reason I ask is not just because I'm curious but because I'd like to have some kind of password system in a program that I'm writing. If it's too complicated then is there at least a free library out there that I can use (preferably in C/C++)?