Advertisement
Guest User

Untitled

a guest
Aug 20th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include<iostream>
  2. #include<conio.h>
  3.  
  4. #define s(a, b0)printf(a,b0)
  5.  
  6. int main() {
  7.     char v[20] = "\x91\xf5\x42\x99\x85\x82\xd8\x84\x83\xd9\xc2\xc1\xc0\xc5\xcf\x2c\x5d\xea", o[4] = {0};
  8.     long p = 0x59847853, q = 0x000000FF;
  9.     bool b0 = 0;
  10.  
  11.     s("Enter a password: ", 0);
  12.     for (int i = 0; b0 != 1; i++) {
  13.         o[i] = (char) _getch();
  14.         p *= o[i];
  15.         putchar(o[i]);
  16.  
  17.         if (i == 3) {
  18.             for (i = 0; i < 15; i++) {
  19.                 for (int k = 0, d = 0; k < 4; k++, d++) {
  20.                     v[i + k] = (char) (v[i + k] ^ ((p >> d) & q));
  21.                 }
  22.             }
  23.  
  24.             if (p == 0x9c5efee3)
  25.                 s("\r\n%s\r\n", v);
  26.             else
  27.                 s("WRONG!\r\n", 0);
  28.             b0 = 1;
  29.         }
  30.     }
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement