For the first question, it depends on the encryption
algorithm you want to use. If it was cold fusion hash, a simple
update query will do.
For the 2nd question, once again it's simple sql. Hash the
test password sting so you are comparing one hashed value to
another.