Solved

no echo for a password field

Posted on 1996-12-09
1
1,021 Views
Last Modified: 2013-11-18
  I'm on a unix system running "SunOS Release 4.1.2 (GENERIC)" on a Sun SPARC station 670MP.  I'm using the GNU project C and C++ Compiler (v2.4).
   I need to get keyboard input and store it without echoing the typed characters to the screen like in a password prompt...
   I've recieved many suggestions (on IRC) telling me to use the getchar(), getch(), getc() functions.  When I use these, however, I can still see typed characters...
   I've also tried changing the text color with textcolor() to that of the background, but the compiler I'm using doesn't have the conio.h header file.  
   If you have any suggestions let me know, please tell me the header files and libraries required to do this.
0
Comment
Question by:GBurk
1 Comment
 
LVL 1

Accepted Solution

by:
evilgreg earned 100 total points
Comment Utility
Have you tried curses?

#include <curses.h>

initscr();
noecho();
/** Grab password **/
echo();


Of course, there is a lot more to curses than this, but it's worth the effort to learn.

Make sure to compile with "-lcurses".

Try man curses or man 3 echo for more...


0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now