It already works like that. The 'p' flag in $input() enables the password chars.