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!

TEXT ENCRYPTION

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi there,
i have a project to emulate a carpark system and want the user to inout a PIN from the keyboard...without displaying it on the screen(i.e * display for every digit)
i have been trying to do it in VC++ 6.0 but cannot figure out how.
i would appreciate any help
peace out
Tam
 
Hi,
If you were writing a windows program, than the CEdit control has an edit style called ES_PASSWORD that automatically handles the password protection for you. Otherwise, I believe that you have to do it yourself. You could read chars without echo (using _getch), and echo an asterisk with putc, for example.
Hope this helps,
Steve [dazed]
 
This MAY be what your looking for, if not, let me know.



int wildcmp(char *wild, char *string)
{
char *cp, *mp;


while ((*string) && (*wild != '*'))
{


if ((*wild != *string) && (*wild != '?'))
{
return 0;
}

wild++;
string++;

}


while (*string)
{


if (*wild == '*')
{


if (!*++wild)
{
return 1;
}
mp = wild;
cp = string+1;


}
else if ((*wild == *string) || (*wild == '?'))
{
wild++;
string++;
}
else
{
wild = mp;
string = cp++;
}
}


while (*wild == '*')
{
wild++;
}

return !*wild;
}
Cyprus
[noevil]
 
Hi Cyprus106, Baggiowen did not ask for a routine to
validate the password, just to enter it with asterisks to
display in place of the characters typed, which I have already answered! [mad]

 
oh, My bad! First of all, I placed the wrong code! Second, I had opened the question and left it open for a number of hours. I hadn't known you had already answered the question. Sorry, I really dropped the ball on that one! Cyprus
[noevil]
 
Alright, this was what I was looking for earlier, but I sent out the wrong code. My apologies, srfink, I'm merely trying to help Baggiowen out. I know you've already answered the question, but varition is the key to good problem-solving.


Try that, I'm fairly sure that was what you were asking about, it just took me a while to find the code. There's no download necessary, the code is posted. Cyprus
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top