GL1TCH3D

encryptor

Jan 14th, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.91 KB | None | 0 0
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. :retry
  4. set /p dire=Set the filepath to the file containing the plain text:
  5. if not exist %dire% cls & goto retry
  6.  
  7. for /l %%n in (1,1,10000) do (
  8. for /n "tokens=* skip=%%n" %%a in (%dire%) do (
  9. if ""=="%%a" goto skip1
  10. set line%%n=%%a
  11. )
  12. )
  13. :skip1
  14. set line=1
  15. set num=1
  16. set a=0
  17. ::start by converting text to binary
  18. :loopp1
  19.  
  20. if ""=="!line%line%:~%a%,1!" goto end1
  21. if " "=="!line%line%:~%a%,1!" set c=00100000 &goto ope1
  22. if "1"=="!line%line%:~%a%,1!" set c=00110001 &goto ope1
  23. if "2"=="!line%line%:~%a%,1!" set c=00110010 &goto ope1
  24. if "3"=="!line%line%:~%a%,1!" set c=00110011 &goto ope1
  25. if "4"=="!line%line%:~%a%,1!" set c=00110100 &goto ope1
  26. if "5"=="!line%line%:~%a%,1!" set c=00110101 &goto ope1
  27. if "6"=="!line%line%:~%a%,1!" set c=00110110 &goto ope1
  28. if "7"=="!line%line%:~%a%,1!" set c=00110111 &goto ope1
  29. if "8"=="!line%line%:~%a%,1!" set c=00111000 &goto ope1
  30. if "9"=="!line%line%:~%a%,1!" set c=00111001 &goto ope1
  31. if "0"=="!line%line%:~%a%,1!" set c=00110000 &goto ope1
  32. if "a"=="!line%line%:~%a%,1!" set c=01100001 &goto ope1
  33. if "b"=="!line%line%:~%a%,1!" set c=01100010 &goto ope1
  34. if "c"=="!line%line%:~%a%,1!" set c=01100011 &goto ope1
  35. if "d"=="!line%line%:~%a%,1!" set c=01100100 &goto ope1
  36. if "e"=="!line%line%:~%a%,1!" set c=01100101 &goto ope1
  37. if "f"=="!line%line%:~%a%,1!" set c=01100110 &goto ope1
  38. if "g"=="!line%line%:~%a%,1!" set c=01100111 &goto ope1
  39. if "h"=="!line%line%:~%a%,1!" set c=01101000 &goto ope1
  40. if "i"=="!line%line%:~%a%,1!" set c=01101001 &goto ope1
  41. if "j"=="!line%line%:~%a%,1!" set c=01101010 &goto ope1
  42. if "k"=="!line%line%:~%a%,1!" set c=01101011 &goto ope1
  43. if "l"=="!line%line%:~%a%,1!" set c=01101100 &goto ope1
  44. if "m"=="!line%line%:~%a%,1!" set c=01101101 &goto ope1
  45. if "n"=="!line%line%:~%a%,1!" set c=01101110 &goto ope1
  46. if "o"=="!line%line%:~%a%,1!" set c=01101111 &goto ope1
  47. if "p"=="!line%line%:~%a%,1!" set c=01110000 &goto ope1
  48. if "q"=="!line%line%:~%a%,1!" set c=01110001 &goto ope1
  49. if "r"=="!line%line%:~%a%,1!" set c=01110010 &goto ope1
  50. if "s"=="!line%line%:~%a%,1!" set c=01110011 &goto ope1
  51. if "t"=="!line%line%:~%a%,1!" set c=01110100 &goto ope1
  52. if "u"=="!line%line%:~%a%,1!" set c=01110101 &goto ope1
  53. if "v"=="!line%line%:~%a%,1!" set c=01110110 &goto ope1
  54. if "w"=="!line%line%:~%a%,1!" set c=01110111 &goto ope1
  55. if "x"=="!line%line%:~%a%,1!" set c=01111000 &goto ope1
  56. if "y"=="!line%line%:~%a%,1!" set c=01111001 &goto ope1
  57. if "z"=="!line%line%:~%a%,1!" set c=01111010 &goto ope1
  58. if "A"=="!line%line%:~%a%,1!" set c=01000001 &goto ope1
  59. if "B"=="!line%line%:~%a%,1!" set c=01000010 &goto ope1
  60. if "C"=="!line%line%:~%a%,1!" set c=01000011 &goto ope1
  61. if "D"=="!line%line%:~%a%,1!" set c=01000100 &goto ope1
  62. if "E"=="!line%line%:~%a%,1!" set c=01000101 &goto ope1
  63. if "F"=="!line%line%:~%a%,1!" set c=01000110 &goto ope1
  64. if "G"=="!line%line%:~%a%,1!" set c=01000111 &goto ope1
  65. if "H"=="!line%line%:~%a%,1!" set c=01001000 &goto ope1
  66. if "I"=="!line%line%:~%a%,1!" set c=01001001 &goto ope1
  67. if "J"=="!line%line%:~%a%,1!" set c=01001010 &goto ope1
  68. if "K"=="!line%line%:~%a%,1!" set c=01001011 &goto ope1
  69. if "L"=="!line%line%:~%a%,1!" set c=01001100 &goto ope1
  70. if "M"=="!line%line%:~%a%,1!" set c=01001101 &goto ope1
  71. if "N"=="!line%line%:~%a%,1!" set c=01001110 &goto ope1
  72. if "O"=="!line%line%:~%a%,1!" set c=01001111 &goto ope1
  73. if "P"=="!line%line%:~%a%,1!" set c=01010000 &goto ope1
  74. if "Q"=="!line%line%:~%a%,1!" set c=01010001 &goto ope1
  75. if "R"=="!line%line%:~%a%,1!" set c=01010010 &goto ope1
  76. if "S"=="!line%line%:~%a%,1!" set c=01010011 &goto ope1
  77. if "T"=="!line%line%:~%a%,1!" set c=01010100 &goto ope1
  78. if "U"=="!line%line%:~%a%,1!" set c=01010101 &goto ope1
  79. if "V"=="!line%line%:~%a%,1!" set c=01010110 &goto ope1
  80. if "W"=="!line%line%:~%a%,1!" set c=01010111 &goto ope1
  81. if "X"=="!line%line%:~%a%,1!" set c=01011000 &goto ope1
  82. if "Y"=="!line%line%:~%a%,1!" set c=01011001 &goto ope1
  83. if "Z"=="!line%line%:~%a%,1!" set c=01011010 &goto ope1
  84. set /a a+=1
  85. goto loopp1
  86. :ope1
  87. ::Need to convert the binary to the compressed / encrypted binary
  88. if "!c:~2,1"=="1" set state1=1
  89. set /a added=!c:~3,2! + !c:~5,3!
  90. set b=%b%%c%
  91. set /a a+=1
  92. goto loopp1
  93. :end1
  94.  
  95.  
  96.  
  97.  
  98. set fold=%cd%\
  99. set z=0
  100. set x=output
  101. set i=0
  102. set option=1
  103. set setloc=0
  104. mode 117,30
  105. set a=0
  106. set b=
  107. :op1
  108.  
  109. cls
  110. if not defined b set b=00000000
  111. if %z%==1 goto bend2
  112. echo %cho1% became:
  113. echo %b%
  114. echo.
  115. (echo %cho1% became:
  116. echo %b%
  117. echo.
  118. ) >>%fold%%x%.txt
  119. echo %b% >>%fold%%x%1.txt
  120. goto opt1
  121. :opt2
  122. cls
  123. set d=0
  124. set b=
  125. set a=0
  126. echo This is the option to select a file to convert to binary.
  127. echo Type "exit" to return to the main menu.
  128. echo.
  129. if "%setloc%"=="0" echo You have not set a location for your output file&echo The default location for the output is the current folder&echo You can change this in the options menu.&echo.
  130. echo Enter the filepath of the file you want to convert:
  131. echo (An example would be C:\users\username\desktop\file.txt)
  132. set /p cho2=
  133. if "exit"=="%cho2%" goto top
  134. if not exist %cho2% (
  135. echo Invalid filepath, cannot find %cho2%
  136. ping -n 5 localhost > nul
  137. goto opt2
  138. )
  139. set g=0
  140. set b=
  141. for /f "tokens=*" %%a in (%cho2%) do (
  142. if "!g!"=="0" (
  143. set cho1=%%a
  144. set g=1
  145. goto skipper1
  146. )
  147. )
  148. :skipper1
  149. set z=1
  150. goto op1
  151. :op2
  152. set a=0
  153. set g=0
  154. set b=
  155. for /f "skip=%d% tokens=*" %%a in (%cho2%) do (
  156. if "!g!"=="0" (
  157. set cho1=%%a
  158. set g=1
  159. goto skipper2
  160. )
  161. )
  162. :skipper2
  163. if "%cho1%"=="%last%" goto end2
  164. set last=%cho1%
  165. set z=1
  166. goto op1
  167. :bend2
  168. echo %b%00001101 00001010 >>%fold%%x%2.txt
  169. set /a d+=1
  170. goto op2
  171. :end2
  172. echo Complete conversion of %cho2%
  173. echo %cho2%
  174. echo became
  175. type %fold%%x%2.txt
  176. ping -n 15 localhost > nul
  177. start output2.txt
  178. goto top
  179. :opt6
  180. cls
  181. echo Thank you for using my Binary to Text converter
  182. echo The awesome, GL1TCH3D
  183. ping -n 5 localhost>nul
  184. exit
  185. :opt5
  186. cls
  187. echo This is the options menu.
  188. echo Choose one of the following options:
  189. echo.
  190. echo 1) Change the output file paths and names.
  191. echo 2) Change the color of this window.
  192. echo 3) Back to top menu
  193. set /p chopt=
  194. if "1"=="%chopt%" goto changeout
  195. if "2"=="%chopt%" goto changecol
  196. if "3"=="%chopt%" goto top
  197. echo Invalid entry.
  198. cls
  199. goto opt5
  200. :changeout
  201. echo Enter 1 to change the folder where the output is saved.
  202. echo Enter 2 to change the names of the outputted files.
  203. echo Enter 3 to go to the main menu.
  204. set /p chout=
  205. if "1"=="%chout%" goto setfold
  206. if "2"=="%chout%" goto setname
  207. if "3"=="%chout%" goto top
  208. echo Invalid entry.
  209. cls
  210. goto opt5
  211. :changecol
  212. echo These are the colors:
  213. echo 0 = Black 8 = Gray
  214. echo 1 = Blue 9 = Light Blue
  215. echo 2 = Green A = Light Green
  216. echo 3 = Aqua B = Light Aqua
  217. echo 4 = Red C = Light Red
  218. echo 5 = Purple D = Light Purple
  219. echo 6 = Yellow E = Light Yellow
  220. echo 7 = White F = Bright White
  221. echo.
  222. echo Just type the 2 different colors you want to set.
  223. set /p background=Background color:
  224. set /p font=Font color:
  225. color %background%%font%
  226. goto opt5
  227. :setfold
  228. echo Just press enter to leave the output folder as %fold%
  229. echo An example would be "C:\users\GL1TCH3D\mydocuments\"
  230. set /p fold=
  231. cls
  232. echo Your files will now be outputted as "%fold%%x%#.txt"
  233. ping -n 3 localhost > nul
  234. set setloc=1
  235. goto opt6
  236. setname
  237. echo Just press enter to leave the outputted file names as they are.
  238. echo Remember you can't use ^/ ^\ ^* ^: ^" ^? ^| ^> ^<
  239. echo You do not need to put the extension of the file.
  240. set /p x=%x% to:
  241. ::set /p y=%y% to:
  242. ::set /p j=%j% to:
  243. ::set /p o=%o% to:
  244. goto opt6
  245. :opt3
  246. echo This is the option to type binary into the prompt to convert to text.
  247. echo Type "exit" to return to the main menu.
  248. echo.
  249. if "%setloc%"=="0" echo You have not set a location for your output file&echo The default location for the output is the current folder&echo You can change this in the options menu.&echo.
  250. set /p inp1=Enter the binary you wish to convert:
  251. if "%inp1%"=="exit" goto top
  252. set cho1=%inp1: =%
  253. set v=0
  254. set b=
  255. :op3
  256. set /a a=8*%v%
  257. if ""=="!cho1:~%a%,8!" goto end3
  258. if "00001101"=="!cho1:~%a%,8!" goto end3
  259. if "00000000"=="!cho1:~%a%,8!" set c=* &goto ope3
  260. if "00100000"=="!cho1:~%a%,8!" set c=` &goto ope3
  261. if "00110001"=="!cho1:~%a%,8!" set c=1 &goto ope3
  262. if "00110010"=="!cho1:~%a%,8!" set c=2 &goto ope3
  263. if "00110011"=="!cho1:~%a%,8!" set c=3 &goto ope3
  264. if "00110100"=="!cho1:~%a%,8!" set c=4 &goto ope3
  265. if "00110101"=="!cho1:~%a%,8!" set c=5 &goto ope3
  266. if "00110110"=="!cho1:~%a%,8!" set c=6 &goto ope3
  267. if "00110111"=="!cho1:~%a%,8!" set c=7 &goto ope3
  268. if "00111000"=="!cho1:~%a%,8!" set c=8 &goto ope3
  269. if "00111001"=="!cho1:~%a%,8!" set c=9 &goto ope3
  270. if "00110000"=="!cho1:~%a%,8!" set c=0 &goto ope3
  271. if "01100001"=="!cho1:~%a%,8!" set c=a &goto ope3
  272. if "01100010"=="!cho1:~%a%,8!" set c=b &goto ope3
  273. if "01100011"=="!cho1:~%a%,8!" set c=c &goto ope3
  274. if "01100100"=="!cho1:~%a%,8!" set c=d &goto ope3
  275. if "01100101"=="!cho1:~%a%,8!" set c=e &goto ope3
  276. if "01100110"=="!cho1:~%a%,8!" set c=f &goto ope3
  277. if "01100111"=="!cho1:~%a%,8!" set c=g &goto ope3
  278. if "01101000"=="!cho1:~%a%,8!" set c=h &goto ope3
  279. if "01101001"=="!cho1:~%a%,8!" set c=i &goto ope3
  280. if "01101010"=="!cho1:~%a%,8!" set c=j &goto ope3
  281. if "01101011"=="!cho1:~%a%,8!" set c=k &goto ope3
  282. if "01101100"=="!cho1:~%a%,8!" set c=l &goto ope3
  283. if "01101101"=="!cho1:~%a%,8!" set c=m &goto ope3
  284. if "01101110"=="!cho1:~%a%,8!" set c=n &goto ope3
  285. if "01101111"=="!cho1:~%a%,8!" set c=o &goto ope3
  286. if "01110000"=="!cho1:~%a%,8!" set c=p &goto ope3
  287. if "01110001"=="!cho1:~%a%,8!" set c=q &goto ope3
  288. if "01110010"=="!cho1:~%a%,8!" set c=r &goto ope3
  289. if "01110011"=="!cho1:~%a%,8!" set c=s &goto ope3
  290. if "01110100"=="!cho1:~%a%,8!" set c=t &goto ope3
  291. if "01110101"=="!cho1:~%a%,8!" set c=u &goto ope3
  292. if "01110110"=="!cho1:~%a%,8!" set c=v &goto ope3
  293. if "01110111"=="!cho1:~%a%,8!" set c=w &goto ope3
  294. if "01111000"=="!cho1:~%a%,8!" set c=x &goto ope3
  295. if "01111001"=="!cho1:~%a%,8!" set c=y &goto ope3
  296. if "01111010"=="!cho1:~%a%,8!" set c=z &goto ope3
  297. if "01000001"=="!cho1:~%a%,8!" set c=A &goto ope3
  298. if "01000010"=="!cho1:~%a%,8!" set c=B &goto ope3
  299. if "01000011"=="!cho1:~%a%,8!" set c=C &goto ope3
  300. if "01000100"=="!cho1:~%a%,8!" set c=D &goto ope3
  301. if "01000101"=="!cho1:~%a%,8!" set c=E &goto ope3
  302. if "01000110"=="!cho1:~%a%,8!" set c=F &goto ope3
  303. if "01000111"=="!cho1:~%a%,8!" set c=G &goto ope3
  304. if "01001000"=="!cho1:~%a%,8!" set c=H &goto ope3
  305. if "01001001"=="!cho1:~%a%,8!" set c=I &goto ope3
  306. if "01001010"=="!cho1:~%a%,8!" set c=J &goto ope3
  307. if "01001011"=="!cho1:~%a%,8!" set c=K &goto ope3
  308. if "01001100"=="!cho1:~%a%,8!" set c=L &goto ope3
  309. if "01001101"=="!cho1:~%a%,8!" set c=M &goto ope3
  310. if "01001110"=="!cho1:~%a%,8!" set c=N &goto ope3
  311. if "01001111"=="!cho1:~%a%,8!" set c=O &goto ope3
  312. if "01010000"=="!cho1:~%a%,8!" set c=P &goto ope3
  313. if "01010001"=="!cho1:~%a%,8!" set c=Q &goto ope3
  314. if "01010010"=="!cho1:~%a%,8!" set c=R &goto ope3
  315. if "01010011"=="!cho1:~%a%,8!" set c=S &goto ope3
  316. if "01010100"=="!cho1:~%a%,8!" set c=T &goto ope3
  317. if "01010101"=="!cho1:~%a%,8!" set c=U &goto ope3
  318. if "01010110"=="!cho1:~%a%,8!" set c=V &goto ope3
  319. if "01010111"=="!cho1:~%a%,8!" set c=W &goto ope3
  320. if "01011000"=="!cho1:~%a%,8!" set c=X &goto ope3
  321. if "01011001"=="!cho1:~%a%,8!" set c=Y &goto ope3
  322. if "01011010"=="!cho1:~%a%,8!" set c=Z &goto ope3
  323. if "00101100"=="!cho1:~%a%,8!" set c=, &goto ope3
  324. if "00101110"=="!cho1:~%a%,8!" set c=. &goto ope3
  325. if "00101111"=="!cho1:~%a%,8!" set c=/ &goto ope3
  326. if "00111111"=="!cho1:~%a%,8!" set c=? &goto ope3
  327. if "00100111"=="!cho1:~%a%,8!" set c=' &goto ope3
  328. if "00100010"=="!cho1:~%a%,8!" set c=" &goto ope3
  329. if "00111010"=="!cho1:~%a%,8!" set c=: &goto ope3
  330. if "00111011"=="!cho1:~%a%,8!" set c=; &goto ope3
  331. if "01011100"=="!cho1:~%a%,8!" set c=\ &goto ope3
  332. if "01111110"=="!cho1:~%a%,8!" set c=~ &goto ope3
  333. if "01100000"=="!cho1:~%a%,8!" set c=` &goto ope3
  334. if "01000000"=="!cho1:~%a%,8!" set c=@ &goto ope3
  335. if "00100011"=="!cho1:~%a%,8!" set c=# &goto ope3
  336. if "00100100"=="!cho1:~%a%,8!" set c=$ &goto ope3
  337. if "00101101"=="!cho1:~%a%,8!" set c=- &goto ope3
  338. if "01011111"=="!cho1:~%a%,8!" set c=_ &goto ope3
  339. if "00111101"=="!cho1:~%a%,8!" set c== &goto ope3
  340. if "00101011"=="!cho1:~%a%,8!" set c=+ &goto ope3
  341. if "00101000"=="!cho1:~%a%,8!" set c=( &goto ope3
  342. if "00101001"=="!cho1:~%a%,8!" set c=) &goto ope3
  343. if "01011011"=="!cho1:~%a%,8!" set c=[ &goto ope3
  344. if "01011101"=="!cho1:~%a%,8!" set c=] &goto ope3
  345. if "01111011"=="!cho1:~%a%,8!" set c={ &goto ope3
  346. if "01111101"=="!cho1:~%a%,8!" set c=} &goto ope3
  347. if "00101010"=="!cho1:~%a%,8!" set c=* &goto ope3
  348. if not %i%==1 echo "!cho1:~%a%,8!" is not in the database.
  349. set /a v+=1
  350. goto op3
  351. :ope3
  352. set b=%b%%c%
  353. set /a v+=1
  354. goto op3
  355. :end3
  356. cls
  357. set b=%b: =%
  358. set b=%b:`= %
  359. if "%i%"=="1" goto bend4
  360. echo %inp1% became:
  361. echo %b%
  362. echo.
  363. (echo %inp1% became:
  364. echo %b%
  365. echo.
  366. ) >>%fold%%x%.txt
  367. echo %b% >%fold%%x%3.txt
  368. goto opt3
  369. :opt4
  370. cls
  371. set d=0
  372. set b=
  373. set v=0
  374. echo This is the option to select a binary file to convert to text.
  375. echo Type "exit" to return to the main menu.
  376. echo.
  377. if "%setloc%"=="0" echo You have not set a location for your output file&echo The default location for the output is the current folder&echo You can change this in the options menu.&echo.
  378. echo Enter the filepath of the file you want to convert:
  379. echo (An example would be C:\users\username\desktop\file.txt)
  380. set /p cho2=
  381. if "exit"=="%cho2%" goto top
  382. if not exist %cho2% (
  383. echo Invalid filepath, cannot find %cho2%
  384. ping -n 5 localhost > nul
  385. goto opt4
  386. )
  387. set g=0
  388. set b=
  389. for /f "tokens=*" %%a in (%cho2%) do (
  390. if "!g!"=="0" (
  391. set cho1=%%a
  392. set g=1
  393. goto skipper3
  394. )
  395. )
  396. :skipper3
  397. set cho1=%cho1: =%
  398. set i=1
  399. goto op3
  400. :op4
  401. set v=0
  402. set g=0
  403. set b=
  404. for /f "skip=%d% tokens=*" %%b in (%cho2%) do (
  405. if "!g!"=="0" (
  406. set cho3=%%b
  407. set g=1
  408. goto skipper4
  409. )
  410. )
  411. :skipper4
  412. if "%cho3%"=="%last%" goto end4
  413. set last=%cho3%
  414. set cho1=%cho3: =%
  415. goto op3
  416. :bend4
  417. echo %b% >>%fold%%x%4.txt
  418. set /a d+=1
  419. goto op4
  420. :end4
  421. echo Complete conversion of %cho2%
  422. echo %cho2%
  423. echo became
  424. type %fold%%x%4.txt
  425. start %fold%%x%4.txt
  426. ping -n 15 localhost > nul
  427. goto top
Advertisement
Add Comment
Please, Sign In to add comment