Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <stdlib.h>
- using namespace std;
- void Pass();
- void GenPass();
- string Decrypt(string passhash);
- int main()
- {
- Pass();
- system("PAUSE");
- return 0;
- }
- string Decrypt(string passhash)
- {
- int len = passhash.length();
- char a;
- string strFinal(passhash);
- for (int i = 0; i <= (len-1); i++)
- {
- a = passhash.at(i);
- int b = (int)a;
- b -= 2;
- a = (char)b;
- strFinal.insert(i, 1, a);
- }
- string strDecrypted(strFinal, 0, len);
- return strDecrypted;
- }
- void Pass()
- {
- char pass[25];
- string passhash;
- passhash = "rcvcyc";
- passhash = Decrypt(passhash);
- cout << "Enter Password : " << endl;
- cin >> pass;
- if(pass == passhash)
- {
- system("cls");
- cout << "Access Granted!";
- }
- else
- {
- system("cls");
- cout << "Access Denied!";
- }
- cout << endl;
- }
Add Comment
Please, Sign In to add comment