Password checker | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Password checker

hi everybody . i am writing a code this one that follows here : #include <iostream> #include <string> using namespace std; int main() { string password; cout << "Sign in" << "\n"; getline(cin,password, '\n'); if (password == "xxxxxxxxxx"){ cout << "access granted" << "\n"; } else { cout << " Access denied ! Bad password." << "\n"; } return 0; } well i need some help here : * i need a loop , so that every time the wrong PW is typed in , the access is denied . * i need to put it in MS VB and make an executable that launches with Windows as i turn the PC on ; in a maximized window , with the 'close window disabled' . I'll be grateful , guys thanks in advance .

25th Oct 2016, 1:08 PM
Nizar Derbel
Nizar Derbel  - avatar
2 Answers
+ 2
Why not just enable the Windows login screen? This would be much, MUCH more secure.
25th Oct 2016, 4:08 PM
Zen
Zen - avatar
0
1. while(!password=="xxxxxxxxxxxxxxx"){ cout << "Bad password!"; cin >> password; } BTW, if this should be "really" secure you should obfuscate your code, so an attacker wont be able to simply use revers engineering to get the password
25th Oct 2016, 1:56 PM
david_hil