read-passwd

read-passwd is a compiled Lisp function in `subr.el'.

(read-passwd PROMPT &optional CONFIRM DEFAULT)

Read a password, prompting with PROMPT, and return it.
If optional CONFIRM is non-nil, read the password twice to make sure.
Optional DEFAULT is a default password to use instead of empty input.

This function echoes `.' for each character that the user types.
You could let-bind `read-hide-char' to another hiding character, though.

Once the caller uses the password, it can erase the password
by doing (clear-string STRING).