If you encrypt the password before placing it into the DB with a one-way method such as MD5, then to check it, encrypt the password they gave, and check the two encrypted versions. Since it is very difficult to get at the password from the encrypted version, it is much more secure.