You might look at the way Zen Cart does this for the password on account creation