Basics of password generation logic.