Support passwords with spaces

Trailing spaces will still be trimmed.