Click to See Complete Forum and Search --> : Fancy C function for typing in a password ??
Zer0FreeZ
05-06-2001, 09:14 AM
I am writing a booking system where users log in by typing a password and i was wondering if it is possible to make this look a bit better by changing the charcter that is typed in into a '*' as they type, so you can't see the password that is being typed in?
Any help would be appreciated.
Zer0FreeZ
Qubit
05-06-2001, 12:54 PM
Not with the standard C functions, I suppose.
You can use ncurses, which has the ability to:
Turn off echoing of characters
Capture characters one by one
Display an asterisk when the users enters a char
Turn on echoing again
You can also use escape codes to toggle echoing, but you won't have an easy way to get the characters as they come in. (This is basically the standard Unix password behaviour)
Third: you can use a GUI framework like Gtk or QT, which has password textboxes.
theMatrix
05-08-2001, 10:02 AM
I'm not sure, but look at getpass(char* prompt)
(I think it exist in Linux, I've used it in DOS :p )
Energon
05-08-2001, 02:11 PM
'tis there in pwd.h