readpass - Man Page
read password
Library
Readpass library (librpass, -lrpass)
Synopsis
#include <readpass.h>
char * readpass(const char * prompt, char display, size_t len);
Description
The readpass() function reads in password from standard input. readpass displays the prompt, turns off character echo, and reads the password string of up to len number of characters or till a newline character, whichever occurs first. While reading password, readpass shows display character instead of actual input entered by user, and then turns on the character echo.
Return Value
readpass returns pointer to a dynamically allocated buffer holding the password, or NULL otherwise.
Note
The pointer returned, points to the password in its clear text form, thus user should take care of its confidentiality.
Secondly, don't forget to release memory (free(3)) allocated by readpass to store password.
Bugs
If you encounter any problems/bugs in working of readpass(), please send an email to <pj.pandit AT yahoo.co.in> mentioning about problem/bug; while doing so, do include 'readpass()' string in the subject line.
See Also
Author
Prasad J Pandit <pj.pandit AT yahoo.co.in>