This would usually be a server side ASP function.
When a user is created or their password is updated you would pass the plain text password to a function which would create a one way hash of the password. MD5 or similar would usually suffice, but depending on the security required you may want to opt for harder to beat encryption algorithms. The hashed password is then sent to the database for storage in the encrypted format.
When logging in you take the plain text version of the password as entered, hash it using the same algorithm as before, then compare to the stored hashed version in the database. If they are the same, then they have entered the correct password.
You can make this slightly harder for a hacker to crack using something called salt. This is a randomly generated string, stored in the database in plain text, that you add to the original password, and thus the password you are checking, to add some randomness tot he hashed value. If you don't do this then a brute force attack that breaks through one password can be used to break all passwords. If you use salt, then they would only get one password for each brute force attack.