Helpers for password generation and validation