RedouaneRed1

newcrackme.c

Aug 3rd, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.87 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.     char cond1 = 1;
  6.     char cond2 = 1;
  7.     char cond3 = 1;
  8.     char pass[21];
  9.     scanf("%20s", pass);
  10.     // condition 1
  11.     char tab[] = {103, 40, 58, 113, 1, 112, 39, 40, 6, 62};
  12.     for (int i = 0; i < 10; i++)
  13.         if ((char)(pass[2*i] ^ pass[2*i+1]) != tab[i])
  14.             cond1 = 0;
  15.     //condition 2
  16.     char buff[] = "mdouhqgghighmhtjouir";
  17.     for (int i = 0; i < 20; i++)
  18.         if ((pass[i] >> 4) + (pass[i] & 0xf) + 97 != buff[i])
  19.             cond2 = 0;
  20.     //condition 3
  21.     char checksum[] = "UQWTX";
  22.     for (int i = 0; i < 5; i++)
  23.         if ((pass[i] >> 4) + (pass[5+i] >> 4) + (pass[10+i] >> 4) + (pass[15+i] >> 4) + 65 != checksum[i])
  24.             cond3 = 0;
  25.     if (cond1 & cond2 & cond3 == 1)
  26.         printf("YOU WIN!!! Invite your geek friends to the facebook group CyberSecurityDZ\n(If you are able to solve this, then you must have geek friends)\n");
  27.     else
  28.         printf("Try Harder!!!\n");
  29.     return 0;
  30. }
Add Comment
Please, Sign In to add comment