What you want is
password > encryption algorithm > encoded password
A good password encryption algorithm is not reversible. i.e. by taking the resulting encoded password you should not be able to get back to the origional password. Therefore o check the password has been entered correctly you need to encrypt the input using the same algorithm and compare it to the stored encryped password
Also no two passwords should encode to the same value.
A really poor password algorithm may take the password string and replace each character by the next in the alphabet eg a would become b. so:
password > encryption algorithm > qbttxpse
that would be pretty crude and easy to figure out, but it gives the idea. What you want to do is perform a calculation on the string to give the value.
Hope that helps a bit