I've done this with shell scripts using something like:
Code:
stty -echo
printf "Password: "
read pass
stty echo
Looking at an strace of that, it looks like you could skip running stty and issue the ioctl yourself, but that heads out beyond my knowledge...