Guest User

Untitled

a guest
Jan 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. #include <stdlib.h>
  5.  
  6. using namespace std;
  7.  
  8. void Pass();
  9. void GenPass();
  10. string Decrypt(string passhash);
  11.  
  12. int main()
  13. {
  14. Pass();
  15. system("PAUSE");
  16.  
  17. return 0;
  18. }
  19.  
  20. string Decrypt(string passhash)
  21. {
  22. int len = passhash.length();
  23. char a;
  24. string strFinal(passhash);
  25.  
  26. for (int i = 0; i <= (len-1); i++)
  27. {
  28. a = passhash.at(i);
  29. int b = (int)a;
  30. b -= 2;
  31.  
  32. a = (char)b;
  33. strFinal.insert(i, 1, a);
  34. }
  35. string strDecrypted(strFinal, 0, len);
  36. return strDecrypted;
  37. }
  38.  
  39.  
  40. void Pass()
  41. {
  42. char pass[25];
  43. string passhash;
  44.  
  45. passhash = "rcvcyc";
  46.  
  47. passhash = Decrypt(passhash);
  48.  
  49. cout << "Enter Password : " << endl;
  50.  
  51. cin >> pass;
  52.  
  53. if(pass == passhash)
  54. {
  55. system("cls");
  56. cout << "Access Granted!";
  57. }
  58.  
  59. else
  60. {
  61. system("cls");
  62. cout << "Access Denied!";
  63. }
  64.  
  65. cout << endl;
  66. }
Add Comment
Please, Sign In to add comment