Reading a keystroke w/o echo

TGREENIN at ESOC.BITNET TGREENIN at ESOC.BITNET
Tue May 28 01:13:16 AEST 1991



In article <1991May23.184302.13918 at lut.fi>, junki at lut.fi (Juha Nurmela) says:
>Simple solution... Portable ?
>
>puts("Please dim Your monitor with knob called brightness.");
>puts("Then key Your passwd terminating with ENTER and readjust the knob");
>gets(password);
>puts("\n\n\n\n ...50 times ... \n");


Sorry, this just won't work with Teletypes. What you should do is

1. Get the user to check noone is looking.
2. Accept the password and wind the carriage back one line
   (if appropriate).
3. Output a carriage return [:r] followed by sufficient characters
   e.g. '*'s to cover the password.
4. Return step 3, using different characters ('#','@','%' etc.)
   until the password is totally obliterated, the paper has a hole
   worn in it etc. (this can be quite tedious on a 110 baud TTY).
5. If you want a *truly* secure routine, then prompt the user to
   remove the ribbon (if appropriate) and burn it after the program
   has finished running. You may also consider getting him to wipe
   the keyboard clean to get rid of fingerprints on the keytops.

Seriously, folks, this approach was used (other than step 5) on a
CDC Cyber system I used to program on at the University of Manchester
in the early 80's. Mind you, I can't figure how to solve it for using
punched cards as an input medium.

Hope this helps. It's simple, cheap, efficient etc.

Tim Greening-Jackson
E.S.O.C., 6100 Darmstadt, (What used to be West) Germany.



More information about the Comp.lang.c mailing list