Don't encrypt it; hash it.
Secure Password Authentication Explained Simply[
^]
Salted Password Hashing - Doing it Right[
^]
Generate a random salt for each password; append (or prepend) it to the password bytes; then generate a one-way hash of the password. Store the salt and the hash in your file.
When you need to validate the password, load the salt and the hash from the file for the user. Combine the salt with the bytes of the entered password in exactly the same way as before. Generate the one-way hash of the combined value, and compare it to the hash loaded from the file.