The program reads the password from the file called pass.txt and then when the password is changed, it puts the new password back into "pass.txt" How can I encrypt this password in the text file?
else if(tempass != inpass) { cout << "Incorrect password! "; Sleep(2000); system("cls"); cout << "Enter current password(try two): "; // gives user another chance. cin >> tempass; // asks for password system("cls"); if(tempass == pass) { //if password is correct, allows user to change password. cout << "Utility to change password.\n"; cout << "\n"; cout << "CHANGE PASS TO: "; cin >> pass; system("cls"); cout << "RETYPE NEW PASSWORD FOR VERIFICATION: "; cin >> userretype; if(pass == userretype) { ofstream Passfile("pass.txt", ios::out); Passfile << pass; Passfile.close(); cout << "Password successfully changed. Press a key to return to members area. "; _getch(); Members(); }
This post has been edited by hackr20345: 12 January 2010 - 03:10 PM