Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!wuarchive!psuvax1!psuvm!esoc!tgreenin From: TGREENIN@ESOC.BITNET Newsgroups: comp.lang.c Subject: Re: Reading a keystroke w/o echo Message-ID: <91147.164007TGREENIN@ESOC.BITNET> Date: 27 May 91 15:13:16 GMT References: <990007@hpcc01.HP.COM> <1991May23.184302.13918@lut.fi> Lines: 35 Organisation: European Space Operation Centre (E.S.O.C) In article <1991May23.184302.13918@lut.fi>, junki@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.