home *** CD-ROM | disk | FTP | other *** search
/ Millennium Time Capsule / AC2000.BIN / disks / hbasic_1 / source / tpp.bas < prev    next >
Encoding:
BASIC Source File  |  1996-10-05  |  16.2 KB  |  484 lines

  1. REM TPP - The Power Protector
  2. REM Date : 1/10/1996
  3. REM Date : 5/10/1996 - All En/de-cryption rutines installed
  4. REM                    GEM included
  5.  
  6. REM $option !gy
  7. REM $option k10
  8. REM $include toolbox.bas
  9.  
  10. DEFINT a-z
  11. wx=PEEKW(SYSTAB+58)
  12. wy=PEEKW(SYSTAB+60)
  13. ww=PEEKW(SYSTAB+62)
  14. wh=PEEKW(SYSTAB+64)
  15.  
  16. WINDOW OPEN 1," TPP - The Power Protector V0.06 ",wx,wy,ww,wh,win_all
  17. WINDOW NAME 1," TPP - The Power Protector V0.06 "," TPP "
  18.  
  19. REM 1=Title bar
  20. REM 2=Close box
  21. REM 4=Full box
  22. REM 8=Move box
  23. REM 16=Info line
  24. REM 32=Size box
  25. REM 64=Up arrow
  26. REM 128=Down arrow
  27. REM 256=Vertical slider
  28. REM 512=Left Arrow
  29. REM 1024=Right arrow
  30. REM 2048=Horizontal slider
  31.  
  32. WINDOW OUTPUT 1
  33.  
  34. WINDOW CONTRL 1,3,1000
  35. WINDOW CONTRL 1,2,1000
  36.  
  37. WINDOW ON
  38.  
  39.  
  40. PRINT
  41. PRINT "          TPP™ V0.06"
  42. PRINT "             The Power Protector"
  43. PRINT "                By Paul Jones"
  44. PRINT
  45. PRINT "Type 'COMMANDS' for list of commands"
  46. PRINT
  47.  
  48. SUB info
  49. END SUB
  50.  
  51. SUB comlist
  52. PRINT
  53. PRINT "Command list:-"
  54. PRINT
  55. PRINT "Type in a file name for en/de-cryption"
  56. PRINT "Type in 'EXIT' to quit"
  57. PRINT "Type in 'INFO' for info"
  58. PRINT
  59. END SUB
  60.  
  61. SUB decrypt
  62. STATIC a$,b$,a$,dummy$,dummy2$,pa,l&,f2$,p$,g$,b,c,p,d,ch,ch$,r,b2,ch2
  63. SHARED a$,b$,a$,dummy$,dummy2$,pa,l&,f2$,p$,g$,b,c,p,d,ch,ch$,r,b2,ch2
  64.  
  65. ch=0
  66. PRINT
  67. PRINT "Decryption code - Version 0.2 - 5/10/1996"
  68. PRINT "©copyright Paul Jones to TPP™"
  69. PRINT
  70. a$=UCASE$(a$)
  71. PRINT "Are you sure you want to decrypt the file '"+a$+"'?"
  72. PRINT "Answer: Y/N: ";
  73. WINDOW NAME 1," TPP - The Power Protector V0.06 "," Input: "
  74.  
  75. DO
  76. b$=INKEY$
  77. LOOP UNTIL UCASE$(b$)="N" OR UCASE$(b$)="Y"
  78. PRINT b$
  79. IF UCASE$(b$)="N" THEN PRINT "Aborted..." : PRINT : EXIT SUB
  80.  
  81. OPEN a$ FOR INPUT AS #1
  82. l&=LOF(1)
  83. FOR pa=1 TO 3
  84. dummy$=dummy$+INPUT$ (1,#1)
  85. ch=ch+1
  86. NEXT pa
  87. IF dummy$<>"TPP" THEN PRINT "Not TPP file..." : CLOSE #1 : EXIT SUB
  88. dummy$=INPUT$ (1,#1)
  89. ch=ch+1
  90. ch$=dummy$
  91. ch2=ch
  92. IF ch$=CHR$(1) THEN
  93.  
  94. pa=1
  95.  
  96. DO
  97. dummy$=INPUT$(1,#1)
  98. ch=ch+1
  99. IF dummy$<>CHR$(0) THEN dummy2$=dummy2$+dummy$
  100. LOOP UNTIL dummy$=CHR$(0)
  101.  
  102. f2$=dummy2$
  103. dummy2$=""
  104. dummy$=""
  105.  
  106. PRINT "Multi-encryption selected..."
  107. PRINT
  108. PRINT "File input: "+a$
  109. PRINT "File output: "+f2$
  110. LINE INPUT "Password?: ",p$
  111. PRINT
  112. PRINT "Pre-encrypting... ";
  113.  
  114. IF FEXISTS(a$)=0 THEN PRINT "error, could not find file." : PRINT : EXIT SUB
  115.  
  116. PRINT "done."
  117.  
  118. WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 000% completed "
  119.  
  120. PRINT "Decrypting..."
  121.  
  122. OPEN f2$ FOR OUTPUT AS #2
  123.  
  124. FOR pa=1 TO l&-ch
  125. g$=INPUT$ (1,#1)
  126. b=ASC(g$)
  127. FOR c=1 TO LEN(p$)
  128. b=b XOR ASC(MID$(p$,c,1))
  129. NEXT c
  130.  
  131. PRINT #2,CHR$(b);
  132.  
  133. p=(pa/l&)*100
  134. p=CINT(p)
  135. IF p=5 AND d=0 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 005% completed " : d=1
  136. IF p=10 AND d=1 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 010% completed " : d=2
  137. IF p=15 AND d=2 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 015% completed " : d=3
  138. IF p=20 AND d=3 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 020% completed " : d=4
  139. IF p=25 AND d=4 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 025% completed " : d=5
  140. IF p=30 AND d=5 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 030% completed " : d=6
  141. IF p=35 AND d=6 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 035% completed " : d=7
  142. IF p=40 AND d=7 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 040% completed " : d=8
  143. IF p=45 AND d=8 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 045% completed " : d=9
  144. IF p=50 AND d=9 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 050% completed " : d=10
  145. IF p=55 AND d=10 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 055% completed " : d=11
  146. IF p=60 AND d=11 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 060% completed " : d=12
  147. IF p=65 AND d=12 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 065% completed " : d=13
  148. IF p=70 AND d=13 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 070% completed " : d=14
  149. IF p=75 AND d=14 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 075% completed " : d=15
  150. IF p=80 AND d=15 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 080% completed " : d=16
  151. IF p=85 AND d=16 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 085% completed " : d=17
  152. IF p=90 AND d=17 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 090% completed " : d=18
  153. IF p=95 AND d=18 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 095% completed " : d=19
  154. IF p=100 AND d=19 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 100% completed " : d=20
  155. NEXT pa
  156.  
  157. d=0
  158. CLOSE #1
  159. CLOSE #2
  160. PRINT
  161. PRINT "File conversion finished."
  162. WINDOW NAME 1," TPP - The Power Protector V0.06 "," TPP "
  163. END IF
  164.  
  165. IF ch$=CHR$(2) THEN
  166. ch=ch2
  167. pa=1
  168.  
  169. DO
  170. dummy$=INPUT$(1,#1)
  171. ch=ch+1
  172. IF dummy$<>CHR$(0) THEN dummy2$=dummy2$+dummy$
  173. LOOP UNTIL dummy$=CHR$(0)
  174.  
  175. f2$=dummy2$
  176. dummy2$=""
  177. dummy$=""
  178.  
  179. PRINT "Part-decryption selected..."
  180. PRINT
  181. PRINT "File input: "+a$
  182. PRINT "File output: "+f2$
  183. WINDOW NAME 1," TPP - The Power Protector V0.06 "," Input: "
  184. LINE INPUT "Password?: ",p$
  185. PRINT
  186. PRINT "Pre-encrypting... ";
  187.  
  188. IF FEXISTS(a$)=0 THEN PRINT "error, could not find file." : PRINT : EXIT SUB
  189.  
  190. PRINT "done."
  191.  
  192. PRINT "Decrypting..."
  193. r=0
  194.  
  195. OPEN f2$ FOR OUTPUT AS #2
  196.  
  197. FOR pa=1 TO l&-ch
  198. g$=INPUT$ (1,#1)
  199. b=ASC(g$)
  200.  
  201. r=r+1 : IF r>LEN(p$) THEN r=1
  202.  
  203. b2=b XOR ASC(MID$(p$,r,1))
  204.  
  205. PRINT #2,CHR$(b2);
  206.  
  207. p=(pa/l&)*100
  208. p=CINT(p)
  209. IF p=5 AND d=0 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 005% completed " : d=1
  210. IF p=10 AND d=1 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 010% completed " : d=2
  211. IF p=15 AND d=2 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 015% completed " : d=3
  212. IF p=20 AND d=3 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 020% completed " : d=4
  213. IF p=25 AND d=4 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 025% completed " : d=5
  214. IF p=30 AND d=5 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 030% completed " : d=6
  215. IF p=35 AND d=6 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 035% completed " : d=7
  216. IF p=40 AND d=7 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 040% completed " : d=8
  217. IF p=45 AND d=8 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 045% completed " : d=9
  218. IF p=50 AND d=9 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 050% completed " : d=10
  219. IF p=55 AND d=10 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 055% completed " : d=11
  220. IF p=60 AND d=11 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 060% completed " : d=12
  221. IF p=65 AND d=12 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 065% completed " : d=13
  222. IF p=70 AND d=13 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 070% completed " : d=14
  223. IF p=75 AND d=14 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 075% completed " : d=15
  224. IF p=80 AND d=15 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 080% completed " : d=16
  225. IF p=85 AND d=16 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 085% completed " : d=17
  226. IF p=90 AND d=17 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 090% completed " : d=18
  227. IF p=95 AND d=18 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 095% completed " : d=19
  228. IF p=100 AND d=19 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Decrypting - 100% completed " : d=20
  229. NEXT pa
  230.  
  231. d=0
  232. CLOSE #1
  233. CLOSE #2
  234. PRINT
  235. PRINT "File conversion finished."
  236. PRINT
  237. WINDOW NAME 1," TPP - The Power Protector V0.06 "," TPP "
  238. END IF
  239.  
  240. END SUB
  241.  
  242. SUB encrypt
  243. STATIC a$,b$
  244. SHARED a$,b$
  245.  
  246. PRINT
  247. PRINT "Encryption code - Version 0.2 - 5/10/1996"
  248. PRINT "©copyright Paul Jones to TPP™"
  249. PRINT
  250. a$=UCASE$(a$)
  251. PRINT "Are you sure you want to encrypt the file '"+a$+"'?"
  252. PRINT "Answer: Y/N: ";
  253. WINDOW NAME 1," TPP - The Power Protector V0.06 "," Input: "
  254.  
  255. DO
  256. b$=INKEY$
  257. LOOP UNTIL UCASE$(b$)="N" OR UCASE$(b$)="Y"
  258. PRINT b$
  259. IF UCASE$(b$)="N" THEN PRINT "Aborted..." : PRINT : EXIT SUB
  260.  
  261. PRINT
  262. PRINT "Please select type of encryption:"
  263. PRINT "1 - Multi-encrypt."
  264. PRINT "2 - Part-encrypt."
  265. PRINT "3 - Help"
  266. PRINT
  267. PRINT "Please select: ";
  268.  
  269. DO
  270. b$=INKEY$
  271.  
  272. IF b$="3" THEN
  273. PRINT
  274. PRINT
  275. PRINT "Type 1 - Multi-encrypt. Each character of the file is encrypted"
  276. PRINT "         with the password. Excelent protection, but suffers"
  277. PRINT "         in the speed department. Best type. Default."
  278. PRINT
  279. PRINT "Type 2 - Part-encrypt. Character by character is encrypted."
  280. PRINT "         Faster the Multi-encrypt, protection not as good as"
  281. PRINT "         Multi-encrypt. Worst type."
  282. PRINT
  283. PRINT "Please select type of encryption:"
  284. PRINT "1 - Multi-encrypt."
  285. PRINT "2 - Part-encrypt."
  286. PRINT "3 - Help"
  287. PRINT 
  288. PRINT "Please select:";
  289. END IF
  290.  
  291. LOOP UNTIL b$="1" OR b$="2"
  292. PRINT b$
  293. PRINT
  294.  
  295. IF b$="1" THEN CALL multien
  296. IF b$="2" THEN CALL parten
  297. END SUB
  298.  
  299. SUB parten
  300. STATIC a$,l&,dummy$,p$,f2$,pa&,p,b,g$,p$,c,d,r,b2
  301. SHARED a$,l&,dummy$,p$,f2$,pa&,p,b,g$,p$,c,d,r,b2
  302.  
  303. PRINT "Part-encryption selected..."
  304. PRINT
  305. PRINT "File input: "+a$
  306. PRINT "File output: ";
  307. f2$=MID$(a$,1,LEN(a$)-3)+"TPP"
  308. PRINT f2$
  309. WINDOW NAME 1," TPP - The Power Protector V0.06 "," Input: "
  310. LINE INPUT "Password?: ",p$
  311. PRINT "Password: '"+p$+"'"
  312. PRINT
  313. PRINT "Pre-encrypting... ";
  314.  
  315. IF FEXISTS(a$)=0 THEN PRINT "error, could not find file." : PRINT : EXIT SUB
  316.  
  317. IF FEXISTS(a$) THEN
  318. OPEN a$ FOR INPUT AS #1
  319. l&=LOF(1)
  320. CLOSE #1
  321. PRINT "done."
  322.  
  323. PRINT "Encrypting..."
  324.  
  325. OPEN a$ FOR INPUT AS #1
  326. OPEN f2$ FOR OUTPUT AS #2
  327.  
  328. REM Send options to file.
  329. REM Type 2 - Part
  330.  
  331. PRINT #2,"T";
  332. PRINT #2,"P";
  333. PRINT #2,"P";
  334. PRINT #2,CHR$(2); 
  335.  
  336. REM Output name, with a null terminator
  337.  
  338. FOR pa&=1 TO LEN(a$)
  339. PRINT #2,MID$(a$,pa&,1);
  340. NEXT pa&
  341. PRINT #2,CHR$(0);
  342.  
  343. FOR pa&=1 TO l&
  344. g$=INPUT$ (1,#1)
  345. b=ASC(g$)
  346.  
  347. r=r+1 : IF r>LEN(p$) THEN r=1
  348.  
  349. b2=b XOR ASC(MID$(p$,r,1))
  350.  
  351. PRINT #2,CHR$(b2);
  352.  
  353. p=(pa&/l&)*100
  354. p=CINT(p)
  355. IF p=5 AND d=0 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 005% completed " : d=1
  356. IF p=10 AND d=1 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 010% completed " : d=2
  357. IF p=15 AND d=2 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 015% completed " : d=3
  358. IF p=20 AND d=3 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 020% completed " : d=4
  359. IF p=25 AND d=4 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 025% completed " : d=5
  360. IF p=30 AND d=5 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 030% completed " : d=6
  361. IF p=35 AND d=6 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 035% completed " : d=7
  362. IF p=40 AND d=7 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 040% completed " : d=8
  363. IF p=45 AND d=8 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 045% completed " : d=9
  364. IF p=50 AND d=9 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 050% completed " : d=10
  365. IF p=55 AND d=10 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 055% completed " : d=11
  366. IF p=60 AND d=11 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 060% completed " : d=12
  367. IF p=65 AND d=12 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 065% completed " : d=13
  368. IF p=70 AND d=13 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 070% completed " : d=14
  369. IF p=75 AND d=14 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 075% completed " : d=15
  370. IF p=80 AND d=15 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 080% completed " : d=16
  371. IF p=85 AND d=16 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 085% completed " : d=17
  372. IF p=90 AND d=17 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 090% completed " : d=18
  373. IF p=95 AND d=18 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 095% completed " : d=19
  374. IF p=100 AND d=19 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 100% completed " : d=20
  375. NEXT pa&
  376.  
  377. d=0
  378. CLOSE #1
  379. CLOSE #2
  380. PRINT
  381. PRINT "File conversion finished."
  382. PRINT
  383. WINDOW NAME 1," TPP - The Power Protector V0.06 "," TPP "
  384. END IF
  385. END SUB
  386.  
  387. SUB multien
  388. STATIC a$,l&,dummy$,p$,f2$,pa&,p,b,g$,p$,c,d
  389. SHARED a$,l&,dummy$,p$,f2$,pa&,p,b,g$,p$,c,d
  390.  
  391. PRINT "Multi-encryption selected..."
  392. PRINT
  393. PRINT "File input: "+a$
  394. PRINT "File output: ";
  395. f2$=MID$(a$,1,LEN(a$)-3)+"TPP"
  396. PRINT f2$
  397. WINDOW NAME 1," TPP - The Power Protector V0.06 "," Input: "
  398. LINE INPUT "Password?: ",p$
  399. PRINT
  400. PRINT "Pre-encrypting... ";
  401.  
  402. IF FEXISTS(a$)=0 THEN PRINT "error, could not find file." : PRINT : EXIT SUB
  403.  
  404. IF FEXISTS(a$) THEN
  405. OPEN a$ FOR INPUT AS #1
  406. l&=LOF(1)
  407. CLOSE #1
  408. PRINT "done."
  409.  
  410. PRINT "Encrypting..."
  411.  
  412. OPEN a$ FOR INPUT AS #1
  413. OPEN f2$ FOR OUTPUT AS #2
  414.  
  415. REM Send options to file.
  416. REM Type 1 - Multi
  417.  
  418. PRINT #2,"T";
  419. PRINT #2,"P";
  420. PRINT #2,"P";
  421. PRINT #2,CHR$(1); 
  422.  
  423. FOR pa&=1 TO LEN(a$)
  424. PRINT #2,MID$(a$,pa&,1);
  425. NEXT pa&
  426. PRINT #2,CHR$(0);
  427.  
  428. FOR pa&=1 TO l&
  429. g$=INPUT$ (1,#1)
  430. b=ASC(g$)
  431. FOR c=1 TO LEN(p$)
  432. b=b XOR ASC(MID$(p$,c,1))
  433. NEXT c
  434.  
  435. PRINT #2,CHR$(b);
  436.  
  437. p=(pa&/l&)*100
  438. p=CINT(p)
  439. IF p=5 AND d=0 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 005% completed " : d=1
  440. IF p=10 AND d=1 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 010% completed " : d=2
  441. IF p=15 AND d=2 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 015% completed " : d=3
  442. IF p=20 AND d=3 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 020% completed " : d=4
  443. IF p=25 AND d=4 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 025% completed " : d=5
  444. IF p=30 AND d=5 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 030% completed " : d=6
  445. IF p=35 AND d=6 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 035% completed " : d=7
  446. IF p=40 AND d=7 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 040% completed " : d=8
  447. IF p=45 AND d=8 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 045% completed " : d=9
  448. IF p=50 AND d=9 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 050% completed " : d=10
  449. IF p=55 AND d=10 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 055% completed " : d=11
  450. IF p=60 AND d=11 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 060% completed " : d=12
  451. IF p=65 AND d=12 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 065% completed " : d=13
  452. IF p=70 AND d=13 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 070% completed " : d=14
  453. IF p=75 AND d=14 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 075% completed " : d=15
  454. IF p=80 AND d=15 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 080% completed " : d=16
  455. IF p=85 AND d=16 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 085% completed " : d=17
  456. IF p=90 AND d=17 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 090% completed " : d=18
  457. IF p=95 AND d=18 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 095% completed " : d=19
  458. IF p=100 AND d=19 THEN WINDOW NAME 1," TPP - The Power Protector V0.06 "," Encrypting - 100% completed " : d=20
  459. NEXT pa&
  460.  
  461. d=0
  462. CLOSE #1
  463. CLOSE #2
  464. PRINT
  465. PRINT "File conversion finished."
  466. WINDOW NAME 1," TPP - The Power Protector V0.06 "," TPP "
  467. END IF
  468. END SUB
  469.  
  470. SUB endecrypt
  471. STATIC a$
  472. SHARED a$
  473. IF RIGHT$(a$,3)="TPP" THEN CALL decrypt ELSE CALL encrypt
  474. END SUB
  475.  
  476. DO
  477. LINE INPUT "Option: ",a$
  478. a$=UCASE$(a$)
  479. IF a$="COMMANDS" THEN CALL comlist
  480. IF a$="EXIT" THEN EXIT DO
  481. IF a$="INFO" THEN CALL info
  482. IF FEXISTS(a$) THEN CALL endecrypt
  483. LOOP UNTIL a$="EXIT"
  484. STOP -1