+ 1
how do u encrypt a cin>>password; dont want the variable password displayed on the out put interface
3 ответов
+ 4
You actually ask two questions, if I get you right:
1) How do I make the char I type in not display on the screen? and
2) How do I encrypt a password?
Trying to achieve 1) you could use the getch() function to read the pwd char by char. Or use cin switch the buffers with another ostream object that doesn't print on screen.
2) Password "encryption" is usually done via hash functions like SHA1 as they provide a simple yet powerful way to map an arbitrary string to something unintelligible that can be used for later checks on the password
0
take every digit or letter of password through getch(), use system("cls"); and cout *. do this with every digit.. u can use a loop
or take every digit or letter of pass through _getch() & cout*.. no need of system cls statement
0
thanks guys.but i still dnt understand it.how abt a simple example? pls dat will.b helpful. thanks