+ 1

how do u encrypt a cin>>password; dont want the variable password displayed on the out put interface

14th Aug 2016, 2:11 AM
emerald peter olu
emerald peter olu - avatar
3 Antworten
+ 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
14th Aug 2016, 9:09 AM
Stefan
Stefan - avatar
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
14th Aug 2016, 11:58 PM
Mahrukh Ahmed
Mahrukh Ahmed - avatar
0
thanks guys.but i still dnt understand it.how abt a simple example? pls dat will.b helpful. thanks
17th Aug 2016, 11:29 PM
emerald peter olu
emerald peter olu - avatar