Or call shasum or sha1sum and input your password on stdin so your shell history doesn't contain your password in plain text.
> echo test
test
> history
...
6730 echo test
6731 history HISTCONTROL=ignorespace
Or even better, though unrelated to this topic... Also get it to ignore duplicates that come next to each other. HISTCONTROL=ignoredups:ignorespace python -c 'import hashlib; from getpass import getpass; s = hashlib.sha1(); s.update(getpass()); print s.hexdigest()'