readpass (3) - Linux Manuals

readpass: read password

NAME

readpass - 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.

AUTHOR

Prasad J Pandit <pj.pandit AT yahoo.co.in>

SEE ALSO

tlock(1)       free(3) crypt(3)