fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. char* cypheredText[] =
  5. {
  6. "Iuarj ck robk ut cgzkx gtj yavvrksktzy",
  7. "hiiG ih ylyq ylybn zc hyjjub xfoiq nubQ",
  8. "XZM TVINH XZGXS TVINH",
  9. "Dltifdeoaseoapndolg",
  10. "yjcv ku vjg pcog qh vjg uauvgo wugf da jco qrgtcvqtu vq ocmg htgg rjqpg ecnnu ?",
  11. "wbth lal voe htat oy voe wxbirtn vfzbqt wagye C poh aeovsn vojgav ?",
  12. "Nyrk grjjnfiu uzu Z xzmv kf jvklg re rttflek fe Kyv Rib ?",
  13. "Flle ujw esc wexp mo xsp kjr hsm hiwwcm, \"Wplpll stq lec qma e wzerg mzkk!\" ?",
  14. "Bmfy ytbs ini N mnij tzy ns zsynq ymj Ozajsnqj Htzwy qtxy ozwnxinhynts tajw rj ?",
  15. "Kyoo olxi rzr Niyovo Cohjpcx ojy dn T apopsy ?",
  16. "Kvoh wg hvs boas ct hvs Doqwtwq Pszz sadzcmss kvc fsor hvs wbhsfboz asac opcih am voqywbu oqhwjwhwsq cjsf hvs voa forwc ?" ,
  17. "Iwh xwqv wpvpj fwr Vfvyj qks wf nzc ncgsoo esg psd gwc ntoqujvr ejs rypz nzfs ?",
  18. "Hsle td esp epcx qzc dzqehlcp mfcypo zy esp nsta esle Yzglepw dpye xp ?",
  19. "Bprf cup esanqneu xmm gtknv amme U biiwy krxheu Iwqt Taied ?",
  20. "Lwpi idlc sxs bn upiwtg axkt xc lwtc X bdkts xc lxiw wxb ?",
  21. "Yhlt xak tzg iytfrfad RanBfld squtpm uhst uquwd ce mswf tz wjrwtsr a wioe lhsv Ecid mwnlkoyee bmt oquwdo't ledn mp acomt ?",
  22. "Zkdw lv wkh qdph ri wkh SL ilup wkdw zdv zluhwdsshg eb Sdflilf Ehoo ?",
  23. "Plpki ytw eai rtc aaspx M llogw qj wef ms rh xq ?",
  24. /*15*/
  25. "Ituot oaybmzk ymwqe ftq pqhuoq ftmf Xqiue geqp fa buow gb mzk dmpua eusmxe zqmd Qduo ?",
  26. "Kwth qzrva rbq lcq rxw Svtg vxcz zm vzs lbfieerl nsem rmh dg ac oef'l cwamu ?",
  27. "Epib qa bpm vium wn bpm ixizbumvb kwuxtmf epmzm Q bziksml lwev Mzqk Pmqvh ?",
  28. /*18*/
  29. "Khkp wg wve kyfcqmm yb hvh TBS oeidr trwh Yhb MmCiwus Wko ogvwgxar hr ?",
  30. "Rcvo dn ivhz ja ocz omvinvxodji oj adiy v kzmnji'n njxdvg nzxpmdot iphwzm pndib oczdm ivhz viy yvoz ja wdmoc ?",
  31. /*20*/
  32. "Wspa wdw gae ypte rj gae dilan lbnsp loeui V tndllrhh gae awvnh \"HZO, hzl jaq M uxla nvu\"",
  33.  
  34.  
  35. //"4A 75 6E 67 20 6A 6E 66 20 62 68 65 20 61 76 70 78 61 6E 7A 72 20 74 76 69 72 61 20 67 62 20 47 72 65 65 6C 20 55 6E 65 71 6C 3F ",
  36. //The above string is just Hexadecimal for character encoding, it translates to the following
  37. "Jung jnf bhe avpxanzr tvira gb Greel Uneql ?",
  38.  
  39. "Gsig cof dsm fkqeoe vnss jo farj tbb epr Csyvd Nnxub mzlr ut grp lne ?",
  40. "Fqjc nunlcaxwrl mnerln mrm cqn OKR rwcnwcrxwjuuh kanjt fqnw cqnh bnjalqnm vh jyjacvnwc rw Ljujkjbjb ?",
  41. /*24*/
  42. "Xvof jq qis bmns lg hvq thlss ktffb J cifsok EAJ uojbthwsbhlsg ?",
  43. "Cngz zuct ngy znk grsg sgzkx lux znk xkgr Kxoi Ckoyy ?",
  44. "Aslx jst rlxi bx ns wgzzcmgw UP jnsh hlrjf nyk TT seq s cojorpdw pssx gxmyeie ao bzy glc ?",
  45. /*27*/
  46. //"85 102 121 114 32 103 113 32 114 102 99 32 108 121 107 99 32 109 100 32 114 102 99 32 122 109 105 113 114 109 112 99 32 71 32 100 112 99 111 115 99 108 114 99 98 32 103 108 32 66 99 108 116 99 112 63",
  47. "Ufyr gq rfc lykc md rfc zmiqrmpc G dpcosclrcb gl Bcltcp ?",
  48.  
  49. "Phtm zvvvkci sw mhx Fmtvr VOX Ycmrt Emki vqimgv vowx hzh L cgf Ecbst ysi ?",
  50. "126 147 172 163 040 166 172 162 040 154 170 040 157 172 162 162 166 156 161 143 040 145 156 161 040 163 147 144 040 115 156 165 144 153 153 040 163 144 161 154 150 155 172 153 040 162 144 161 165 144 161 040 150 155 040 122 172 155 040 111 156 162 144 077",
  51. "Ouop lqeg gs zkds ulv V deds zq lus DS urqstsn't wwiaps ?",
  52. "Alex B25 rixasvo hmh M ywi xs xli HQZ qemrjveqi ?",
  53. "Caem alw Ymek Xptq'd tnwlchvw xz lrv lkkzxv ?",
  54. /*33*/
  55. "Ozg ojglw lzw hshwj gf AH Khggxafy lzsl BKR skcww ew stgml ?",
  56. "Nvbx nte hyv bqgs pj gaabv jmjmwdi whd hyv UVT'g Giuxdoc Gctcwd Hvyqbuvz hycoij ?",
  57. "2B 2T W 2X 2Z 26 36 2P 36 2V 3C W 3A 32 39 38 2Z W 3D 33 31 38 2V 36 3D W 2R 2Z W 3E 3C 2V 2X 2Z 2Y W 3E 39 W 2R 32 2V 2E W 2V 3A 2V 3C 3E 37 2X 38 3E W 2X 39 37 3A 36 2Z 2S 1R",
  58. "Lsar JSA cryoi ergiu lq wipz tnrs dq dccfunaqi zf oj wqpctkiel dpzpgp I jstcgo cu dy hgq ?",
  59. /*37*/
  60. "V2hhdCBGQkkgYWdlbnQgYXNrZWQgU3VuIE1pY3Jvc3lzdGVtcyB0byBjbGFpbSB0aGV51Gxvc3QgODAgbWlsbGlvbiBkb2xsYXJzPw==",
  61. /*38*/
  62. "100-1111-10-0 011-000-1-111 00-0100 1101-10-1110-000-101-11-0-1 \
  63. 0111-110-00-1001-1-101 111-0-11-0101-010-1-101 111-10-0100 11-00-11",
  64.  
  65. };
  66.  
  67. char alphabet[] =
  68. {
  69. 'a',
  70. 'b',
  71. 'c',
  72. 'd',
  73. 'e',
  74. 'f',
  75. 'g',
  76. 'h',
  77. 'i',
  78. 'j',
  79. 'k',
  80. 'l',
  81. 'm',
  82. 'n',
  83. 'o',
  84. 'p',
  85. 'q',
  86. 'r',
  87. 's',
  88. 't',
  89. 'u',
  90. 'v',
  91. 'w',
  92. 'x',
  93. 'y',
  94. 'z'
  95. };
  96.  
  97. char* keyWords[] = {" what "," is "," the "," of "," by "," to ", " did", " in ", " when ", " how "};
  98.  
  99.  
  100. int attempROT(int rot, int cypheredIndex)
  101. {
  102. char tmpString[1024];
  103. int i;
  104. char currentChar ;
  105.  
  106. for(i=0 ; i < strlen(cypheredText[cypheredIndex]) ; i++)
  107. {
  108. currentChar = cypheredText[cypheredIndex][i] ;
  109.  
  110. //Convert to lowercase
  111. if (currentChar >= 65 && currentChar <= 90)
  112. currentChar = currentChar+32;
  113.  
  114. if (currentChar >= 97 && currentChar <= 122)
  115. {
  116. tmpString[i] = alphabet[ (currentChar + rot) % 26 ] ;
  117. }
  118. else
  119. tmpString[i] = cypheredText[cypheredIndex][i];
  120. }
  121. tmpString[i] = '\0';
  122.  
  123.  
  124. //Rotation done, seach for keywords.
  125.  
  126. for(i= 0 ; i < sizeof(keyWords)/sizeof(char*); i++)
  127. {
  128. if (strstr(tmpString,keyWords[i]))
  129. {
  130. printf("[%d]: Candidate (ROT%d): %s\n",cypheredIndex+1,rot,tmpString);
  131. //printf("Found %s at %d\n",keyWords[i],);
  132. return 1;
  133. }
  134. }
  135.  
  136. return 0;
  137. }
  138.  
  139.  
  140.  
  141. int main(int argc, char** argv)
  142. {
  143. int i,j;
  144. int numTexts = sizeof(cypheredText) / sizeof(char*);
  145. int found;
  146.  
  147. for(j=0 ; j < numTexts; j++)
  148. {
  149. //printf("%s\n",cypheredText[j]);
  150. found = 0;
  151. for(i=0 ; i < 26 ; i++)
  152. {
  153. found = found | attempROT(i,j);
  154. }
  155.  
  156. if (!found)
  157. printf("[%d]: No Candidate.\n",j+1);
  158. }
  159. }
  160.  
  161.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
[1]: No Candidate.
[2]: No Candidate.
[3]: No Candidate.
[4]: No Candidate.
[5]: Candidate (ROT5): what is the name of the system used by ham operators to make free phone calls ?
[6]: Candidate (ROT1): qvnb fuf piy bnun is piy qrvclnh pztvkn quasy w jib uyipmh pidaup ?
[7]: Candidate (ROT16): what password did i give to setup an account on the ark ?
[8]: No Candidate.
[9]: Candidate (ROT2): what town did i hide out in until the juvenile court lost jurisdiction over me ?
[10]: Candidate (ROT12): pdtt tqcn wew sndtat htmouhc tod is y futuxd ?
[11]: Candidate (ROT19): what is the name of the pacific bell employee who read the internal memo about my hacking activitiec over the ham radio ?
[12]: No Candidate.
[13]: Candidate (ROT22): what is the term for software burned on the chip that novatel sent me ?
[14]: No Candidate.
[15]: Candidate (ROT18): what town did my father live in when i moved in with him ?
[16]: No Candidate.
[17]: Candidate (ROT4): what is the name of the pi firm that was wiretapped by pacific bell ?
[18]: No Candidate.
[19]: Candidate (ROT20): vghbg bnlozmx lzjdr sgd cduhbd sgzs kdvhr trdc sn ohbj to zmx qzchn rhfzkr mdzq dqhb ?
[19]: Candidate (ROT21): which company makes the device that lewis used to pick up any radio sigals near eric ?
[20]: No Candidate.
[21]: Candidate (ROT25): what is the name of the apartment complex where i tracked down eric heinz ?
[22]: Candidate (ROT8): lilq xh xwf lzgdrnn zc iwi uct pfjes usxi zic nndjxvt xlp phwxhybs is ?
[22]: Candidate (ROT19): wtwb is ihq wkrocyy kn tht fne aqupd fdit ktn yyouige iwa ashisjmd td ?
[23]: Candidate (ROT12): what is name of the transaction to find a person's social security number using their name and date of birth ?
[24]: No Candidate.
[25]: Candidate (ROT20): what was our nickname given to terry hardy ?
[26]: Candidate (ROT6): frhf bne crl ejpdnd umrr in ezqi saa doq brxuc mmwta lykq ts fqo kmd ?
[27]: Candidate (ROT24): what electronic device did the fbi intentionally break when they searched my apartment in calabasas ?
[28]: Candidate (ROT15): fdwn ry yqa juva to pdy bptaa sbnnj r kqnaws mir cwrjbpeajptao ?
[29]: Candidate (ROT1): what town has the alma mater for the real eric weiss ?
[30]: Candidate (ROT2): vngs eno mgsd ws in rbuuxhbr pk einc cgmea itf oo nzl n xjejmkyr knns bshtzdz vj wut bgx ?
[30]: Candidate (ROT6): zrkw irs qkwh aw mr vfyyblfv to imrg gkqie mxj ss rdp r bninqocv orrw fwlxdhd zn ayx fkb ?
[31]: Candidate (ROT9): what is the name of the bokstore i frequented in denver ?
[32]: No Candidate.
[33]: No Candidate.
[34]: Candidate (ROT22): djde aftv vh ozsh jak k stsh of ajh sh jgfhihc'i llxpeh ?
[35]: Candidate (ROT3): what x25 network did i use to the dmv mainframe ?
[36]: No Candidate.
[37]: Candidate (ROT15): who wrote the paper on ip spoofing that jsz askee me about ?
[38]: No Candidate.
[39]: No Candidate.
[40]: Candidate (ROT4): ipxo gpx zovlf bodfr in tfmw qkop an azzcrkxnf wc lg tnmzqhfbi amwmdm f gpqzdl zr av edn ?
[40]: Candidate (ROT12): qxfw oxf hwdtn jwlnz qv bnue yswx iv ihhkzsfvn ek to bvuhypnjq iueulu n oxyhlt hz id mlv ?
[40]: Candidate (ROT23): biqh ziq shoey uhwyk bg myfp jdhi tg tssvkdqgy pv ez mgfsjayub tfpfwf y zijswe sk to xwg ?
[41]: No Candidate.
[42]: No Candidate.