Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.01 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5.  
  6. char dec(char* const data, char* const key, char* out) {
  7.     for (int i = 0; i < 50; i++) {
  8.         out[i] = data[i] ^ key[i % 10];
  9.     }
  10. }
  11.  
  12.  
  13. int main() {
  14.     char enc[] = {166, 210, 19, 150, 121, 59, 16, 100, 104, 117, 159, 221, 70, 159, 93, 23, 85, 106, 104, 67, 143, 140, 45, 146, 49, 7, 84, 96, 104, 38, 159, 205, 70, 135, 49, 42, 84, 123, 4, 95, 166, 235, 6, 164, 112, 48, 17, 50, 74, 10};
  15.  
  16.     char key[10] = {192, 190, 114, 241, 2, 117, 0, 0, 0, 0};
  17.  
  18. // [108, 79, 55, 119]
  19.     char flag;
  20.  
  21.     key[6] = 108;
  22.     char* out = malloc(51);
  23.     memset(out, 0, 51);
  24.     for (int i = 0; i < 256; i++) {
  25.         for (int j = 0; j < 256; j++) {
  26.             for (int k = 0; k < 256; k++) {
  27.                 flag = 1;
  28.                 key[8] = (char)i;
  29.                 key[6] = (char)j;
  30.                 key[7] = (char)k;
  31.                 dec(enc, key, out);
  32.                 for (int p = 0; p < 50; p++) {
  33.                     if (out[p] > 127 || out[p] < 32) {
  34.                         flag = 0;
  35.                         break;
  36.                     }
  37.                 }
  38.                 puts(out);
  39.                 if (flag) {
  40.                     puts(out);
  41.                 }
  42.             }
  43.         }
  44.     }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement