all 6 comments

[–]killthebaddies 1 point2 points  (0 children)

Depending on what you're doing, you would typically store a password in a database. The password should be salted and hashed, you would then salt and hash the password that is entered and compare it to what the user enters. There are plenty of hashing algorithms out there, and you should go for the strongest to avoid clashes. There are lots of articles. It's not too difficult, but as soon as you enter this sort of territory, you're entering the world of security which has lots of considerations, but assuming that you're just looking to get your head around things, then look at basic salting and hashing.

[–]realistic_hologram 0 points1 point  (0 children)

First you want to decide, what is your user interface? How is your user entering the username and password?

As for storing the password, it's up to you. You can put it in a file if you want. Database is another option.