Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide a Password

Status
Not open for further replies.

DjMarkoz

Technical User
Sep 17, 2003
2
US
Hi, How can i hide what i type? i have this code

@ 4,7 SAY 'password' GET mpassword PICTURE '!!!!!!!!!!'

but others can see the password when i type.

Thanks.
Marcos
 
But this includes some encryption?, i just want hide that i type. Is for Foxpro 2.5 Ms-dos?

Marcos
 
There are a good number of postings on this forum about hiding passwords. You might want to do a Keyword Search to read them.

Basically they involve either:
1. Using a different font (such as WingDings, etc.) to display your password in a non-readable manner.

2. Use a more simplistic INPUT routine where you read in the password characters one at a time and programatically send back the 'echo' characters of your choice instead of using an automatic character 'echo'.

The Font method most likely won't work for DOS since I don't think there are non-readable DOS fonts (I could be wrong).

The other method does work in DOS (I have done it). It seems somewhat "clumsy", but operational.

I will add that encryption is a good thing. If your users can get into the password file via Excel (or something else) and easily read everyone's password, how much value is it?

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Marcos,

Yes it is ok for fpd 2.5
It is only a password routine.
Rob.
 


i used the keymask to hide passwords.. it's not actually hiding but it's the same as the inputmask in visual foxpro..

tell me if you need my logon program..

HTH
 
Or the easiest step, set the background color equal to foreground color.

ie: @ 7,7 get cPassowrd pict "@X" COLOR "B/B,B/B"
 
WildSwan's suuggestion is a fast and easy one, however please be advised that the text will still show up when the user highlights it, so to make the solution more complete change the highlight to match as well. this will make the text truly invisible.

Slighthaze = NULL

[ul][li]FAQ184-2483
An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
 
Yet anoder password routine.
Rob.

* password routine
SET CONFIRM OFF
SET BELL OFF
PUBLIC abc
STORE ' ' TO a,b,c,d,e,f,g,h
STORE ' ' TO abc
@ 10, 10 SAY 'Please enter password:' GET abc
CLEAR GETS
@ 10, 33 GET a PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 33 SAY '*' COLOR W+/BG
IF a=SPACE(1)
STORE SPACE(8) TO abc
RETURN
ENDIF
@ 10, 34 GET b PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 34 SAY '*' COLOR W+/BG
IF b=SPACE(1)
abc=a+SPACE(7)
RETURN
ENDIF
@ 10, 35 GET c PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 35 SAY '*' COLOR W+/BG
IF c=SPACE(1)
abc=a+b+SPACE(6)
RETURN
ENDIF
@ 10, 36 GET d PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 36 SAY '*' COLOR W+/BG
IF d=SPACE(1)
abc=a+b+c+SPACE(5)
RETURN
ENDIF
@ 10, 37 GET e PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 37 SAY '*' COLOR W+/BG
IF e=SPACE(1)
abc=a+b+c+d+SPACE(4)
RETURN
ENDIF
@ 10, 38 GET f PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 38 SAY '*' COLOR W+/BG
IF f=SPACE(1)
abc=a+b+c+d+e+SPACE(3)
RETURN
ENDIF
@ 10, 39 GET g PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 39 SAY '*' COLOR W+/BG
IF g=SPACE(1)
abc=a+b+c+d+e+f+SPACE(2)
RETURN
ENDIF
@ 10, 40 GET h PICTURE '!' COLOR BG/BG,BG/BG
READ
@ 10, 40 SAY '*' COLOR W+/BG
IF h=SPACE(1)
abc=a+b+c+d+e+f+g+SPACE(1)
RETURN
ENDIF
abc=a+b+c+d+e+f+g+h
RETURN
 
set inte off
Define window pass from 09,22 to 15,53 title '** SECURITY **' colo sche 1 SHADOW
password="7861"
set colo to
passkeyed=' '
pass=''
count=0
key=0
set curs off
activ wind pass
move wind pass center
@02,06 say ' ' colo br
@01,06 SAY " Enter Password : " colo br*
@02,12 get passkeyed when check() colo br
read cycle
rele windows pass
if lastkey() = 27
clea wind
retu
endif
func check
do while key # 13
count = count +1
key = inkey(0)
pass = upper(alltrim(pass+chr(key)))
passkeyed = stuff(passkeyed,count,1,'*')
show get passkeyed
Enddo
Do Case
Case pass = password
clea read
clea wind
do gamtra1
Case pass!=password
wait wind 'Password Invalid.' nowait
clea read
Endcase

*: EOF: PASS1.PRG

alichanda@hotmail.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top