You might look at the way Zen Cart does this for the password on account creation
Zen-Venom Get Bitten
Forum Rules