do...while loop for password generation