moeminthar ၏

စိတ္ကူးတည့္ရာေရးထားေသာ ဘေလာ့ခ္

Hide password input on terminal

Posted by Zwe on October 14, 2013

I have searched password masking code which can be compile and run on Ubuntu 12.04 environment. At last, I found out one piece of code which serves for my purpose.

#include <stdio.h>
 #include <unistd.h>
 int main()
 {
 char *password; // password string pointer
 password = getpass("Enter Password: "); // get a password
 printf("%s\n",password); // this is just for conformation
 // that password stored successfully
 return 1;
 }

http://stackoverflow.com/questions/6856635/hide-password-input-on-terminal

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: