Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C Linux socket
hi ,
as you know when in UNIX you want to type password nothing display in monitor?
how can i implement it in c?
tnx
Posted 3-Aug-12 23:04pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You just accept keyboard input but don't display it. You would use getch for this, which is in conio.h.
  Permalink  
Comments
Bathooman at 4-Aug-12 4:14am
   
i cant understand what u r trying to say!!
i know about getch
but please give me an example if it is possible
Christian Graus at 4-Aug-12 4:18am
   
I am at a loss. You're learning C, but you don't understand my answer and can't use google ?
 
char c,password[10];
int i;
while( (c=getch())!= '\n');{
password[i] = c;
printf("*");
i++;
}
Bathooman at 4-Aug-12 4:30am
   
First i should say i write in Linux,
and in Linux there isn't any conio.h.
and it is better i say i want to use this in a honeypot. when server send a prompt for client and client want to type password nothing display.
Jochen Arndt at 4-Aug-12 4:38am
   
Christian's code snippet is the answer to your question when changing the function call and the include file for Linux: Use getchar() defined in stdio.h.
Christian Graus at 4-Aug-12 4:33am
   
Ah, it seems in Linux there;s
 
#include
char *getpass(const char *prompt);
Bathooman at 4-Aug-12 4:36am
   
I love you!!
tnx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,142
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 4 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100