1.

Solve : Can we hide or mask user input??

Answer»

Hi,
I have a batch file that will generate an FTP script and execute it to transmit data between the PC and an IBM z/OS mainframe. The password is entered by the user via the SET /P command, but the password entry is displayed on the users screen and is subject to shoulder surfing. Is there any way to hide or mask the data entered via the SET command, or is there another method to accomplish this? Any help would be appreciated.

BillRWe recently had this very same question. Typed data is not taken from the command line and made available from the keyboard device until the enter key is pressed. Since you cannot read a single character as it is typed, there is no way to intercept the character and echo a * or space to the command line. Instead, you can only read complete lines.

You would need to write a front-end GUI for this.

Hope this helps. 8-)Thanks, I had a feeling there was a REASON I couldn't find an easy solution. I did find a solution using QBASIC(from Timo Salmi), but that presents another issue altogether. I don't believe any of the users have QB installed. And I don't have any experience with GUI's, so I am at a loss with that approach.

I'll KEEP plugging away on a solution for the users, but in the meantime I have a solution that will work for me!

Thanks Again
BillYou could write a little assembler program to read a word without echo when this is send to a file:

C:\DOCUME~1\sirio>debug readChar.com
-a
15C2:0100 mov ah,08 <-- read a character without echo
15C2:0102 int 21
15C2:0104 cmp al,d <--is the newline?
15C2:0106 je 110 <-- YES: end
15C2:0108 mov dl,al <-- NO: send the character to console
15C2:010A mov ah,02
15C2:010C int 21
15C2:010E jmp 100 <-- read another char
15C2:0110 ret
15C2:0111
-r cx <-- write in the CX register, the size of the program
CX 0000
:11
-w
Escribiendo 00011 bytes
-q

C:\DOCUME~1\sirio>readChar > pasw.txt
-here, I write HelloWorld-
C:\DOCUME~1\sirio>type pasw.txt
HelloWorld



Discussion

No Comment Found