'=========================================================================== ' Subject: ENCRYPTION PROGRAM Date: 06-21-98 (23:07) ' Author: Chris Pulley Code: QB, QBasic, PDS ' Origin: beelzebu@swbell.net Packet: ALGOR.ABC '=========================================================================== ' Encrypt.bas ' ' Written by Chris Pulley : Email beelzebu@swbell.net ' (C)1998 Syndicate SoftWare Inc... ' ' Encrypt is a simple Encryption Program that Works on the basis of ' switching out characters. It will Encrypt files of any size or type ' but will do regular ASCii files best. ' ' This Code is to be Considered FreeWare and you may use any or all the ' Code in your own Program as Long as you Give Me (Chris Pulley) some credit ' ' There sre two known bugs they are easy to find but hard to fix ' you will see them when you decrypt a file that uses commas and the ' other is a space delete you will notice it to ' ' If you can fix the bugs mail the fixed program back to me in .bas form ' and i will make a new version updated with your name and sent you some ' other shit to ' DECLARE SUB encrypt (file$, output$) DECLARE SUB decrypt (file$, output$) COLOR 4 begin: PRINT PRINT "Encrypt Version 1.0" PRINT "Programmed by: Chris Pulley" PRINT "Email: beelzebu@swbell.net": PRINT PRINT "1: Encrypt" PRINT "2: Decrypt" PRINT "3: Quit": PRINT INPUT "Enter Choice: ", a$ getkey: IF a$ = "1" THEN GOTO encryptfile IF a$ = "2" THEN GOTO decryptfile IF a$ = "3" THEN GOTO quit GOTO getkey encryptfile: PRINT : INPUT "Enter File to Encrypt: ", file$ IF file$ = "" GOTO begin PRINT : INPUT "Enter Output File: ", output$ IF output$ = "" GOTO begin encrypt file$, output$ GOTO begin decryptfile: PRINT : INPUT "Enter File to Decrypt: ", file$ IF file$ = "" GOTO begin PRINT : INPUT "Enter Output File: ", output$ IF output$ = "" GOTO begin decrypt file$, output$ GOTO begin quit: PRINT : PRINT "End Encrypt Version 1.0": PRINT COLOR 7 SYSTEM SUB decrypt (file$, output$) decrypt: OPEN file$ FOR INPUT AS #1 OPEN output$ FOR OUTPUT AS #2 PRINT : PRINT "Decrypting ", file$ begindecryption: DO UNTIL EOF(1) l% = 0: o% = 0 total$ = "" INPUT #1, text$ nextl2: l% = l% + 1 IF MID$(text$, l%, 1) = CHR$(128) THEN w$ = "a": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(251) THEN w$ = "b": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(138) THEN w$ = "c": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(152) THEN w$ = "d": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(172) THEN w$ = "e": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(160) THEN w$ = "f": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(178) THEN w$ = "g": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(224) THEN w$ = "h": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(229) THEN w$ = "i": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(141) THEN w$ = "j": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(158) THEN w$ = "k": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(146) THEN w$ = "l": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(230) THEN w$ = "m": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(247) THEN w$ = "n": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(219) THEN w$ = "o": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(235) THEN w$ = "p": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(168) THEN w$ = "q": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(164) THEN w$ = "r": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(226) THEN w$ = "s": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(240) THEN w$ = "t": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(37) THEN w$ = "u": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(30) THEN w$ = "v": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(155) THEN w$ = "w": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(42) THEN w$ = "x": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(33) THEN w$ = "y": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(232) THEN w$ = "z": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(21) THEN w$ = "A": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(228) THEN w$ = "B": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(174) THEN w$ = "C": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(185) THEN w$ = "D": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(163) THEN w$ = "E": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(171) THEN w$ = "F": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(239) THEN w$ = "G": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(167) THEN w$ = "H": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(188) THEN w$ = "I": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(38) THEN w$ = "J": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(166) THEN w$ = "K": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(134) THEN w$ = "L": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(148) THEN w$ = "M": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(169) THEN w$ = "N": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(233) THEN w$ = "O": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(249) THEN w$ = "P": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(142) THEN w$ = "Q": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(176) THEN w$ = "R": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(31) THEN w$ = "S": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(63) THEN w$ = "T": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(237) THEN w$ = "U": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(94) THEN w$ = "V": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(29) THEN w$ = "W": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(64) THEN w$ = "X": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(192) THEN w$ = "Y": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(253) THEN w$ = "Z": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(150) THEN w$ = "1": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(234) THEN w$ = "2": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(225) THEN w$ = "3": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(132) THEN w$ = "4": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(190) THEN w$ = "5": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(206) THEN w$ = "6": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(246) THEN w$ = "7": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(196) THEN w$ = "8": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(194) THEN w$ = "9": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(137) THEN w$ = "0": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(60) THEN w$ = "+": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(231) THEN w$ = "-": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(126) THEN w$ = "*": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(244) THEN w$ = "/": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(208) THEN w$ = "=": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(191) THEN w$ = "?": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(157) THEN w$ = "!": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(245) THEN w$ = "@": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(241) THEN w$ = "#": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(153) THEN w$ = "$": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(133) THEN w$ = "%": GOTO printl2 IF MID$(text$, l%, 1) = CHR$(173) THEN w$ = "&": GOTO printl2 w$ = MID$(text$, l%, 1): GOTO printl2 printl2: IF w$ = "" THEN o% = o% + 1 total$ = total$ + "" IF o% = 15 THEN GOTO printtotal2 GOTO nextl2 END IF o% = 0 total$ = total$ + w$ GOTO nextl2 printtotal2: PRINT #2, total$ ' GOTO beginencryption LOOP donedecrypt: PRINT PRINT "Decryption of", file$, "is Complete": PRINT PRINT "Use Encrypt to Secure this File" PRINT CLOSE END SUB SUB encrypt (file$, output$) encrypt: OPEN file$ FOR INPUT AS #1 OPEN output$ FOR OUTPUT AS #2 PRINT : PRINT "Encrypting ", file$ beginencryption: DO UNTIL EOF(1) l% = 0: o% = 0 total$ = "" INPUT #1, text$ nextl: l% = l% + 1 IF MID$(text$, l%, 1) = "a" THEN w$ = CHR$(128): GOTO printl IF MID$(text$, l%, 1) = "b" THEN w$ = CHR$(251): GOTO printl IF MID$(text$, l%, 1) = "c" THEN w$ = CHR$(138): GOTO printl IF MID$(text$, l%, 1) = "d" THEN w$ = CHR$(152): GOTO printl IF MID$(text$, l%, 1) = "e" THEN w$ = CHR$(172): GOTO printl IF MID$(text$, l%, 1) = "f" THEN w$ = CHR$(160): GOTO printl IF MID$(text$, l%, 1) = "g" THEN w$ = CHR$(178): GOTO printl IF MID$(text$, l%, 1) = "h" THEN w$ = CHR$(224): GOTO printl IF MID$(text$, l%, 1) = "i" THEN w$ = CHR$(229): GOTO printl IF MID$(text$, l%, 1) = "j" THEN w$ = CHR$(141): GOTO printl IF MID$(text$, l%, 1) = "k" THEN w$ = CHR$(158): GOTO printl IF MID$(text$, l%, 1) = "l" THEN w$ = CHR$(146): GOTO printl IF MID$(text$, l%, 1) = "m" THEN w$ = CHR$(230): GOTO printl IF MID$(text$, l%, 1) = "n" THEN w$ = CHR$(247): GOTO printl IF MID$(text$, l%, 1) = "o" THEN w$ = CHR$(219): GOTO printl IF MID$(text$, l%, 1) = "p" THEN w$ = CHR$(235): GOTO printl IF MID$(text$, l%, 1) = "q" THEN w$ = CHR$(168): GOTO printl IF MID$(text$, l%, 1) = "r" THEN w$ = CHR$(164): GOTO printl IF MID$(text$, l%, 1) = "s" THEN w$ = CHR$(226): GOTO printl IF MID$(text$, l%, 1) = "t" THEN w$ = CHR$(240): GOTO printl IF MID$(text$, l%, 1) = "u" THEN w$ = CHR$(37): GOTO printl IF MID$(text$, l%, 1) = "v" THEN w$ = CHR$(30): GOTO printl IF MID$(text$, l%, 1) = "w" THEN w$ = CHR$(155): GOTO printl IF MID$(text$, l%, 1) = "x" THEN w$ = CHR$(42): GOTO printl IF MID$(text$, l%, 1) = "y" THEN w$ = CHR$(33): GOTO printl IF MID$(text$, l%, 1) = "z" THEN w$ = CHR$(232): GOTO printl IF MID$(text$, l%, 1) = "A" THEN w$ = CHR$(21): GOTO printl IF MID$(text$, l%, 1) = "B" THEN w$ = CHR$(228): GOTO printl IF MID$(text$, l%, 1) = "C" THEN w$ = CHR$(174): GOTO printl IF MID$(text$, l%, 1) = "D" THEN w$ = CHR$(185): GOTO printl IF MID$(text$, l%, 1) = "E" THEN w$ = CHR$(163): GOTO printl IF MID$(text$, l%, 1) = "F" THEN w$ = CHR$(171): GOTO printl IF MID$(text$, l%, 1) = "G" THEN w$ = CHR$(239): GOTO printl IF MID$(text$, l%, 1) = "H" THEN w$ = CHR$(167): GOTO printl IF MID$(text$, l%, 1) = "I" THEN w$ = CHR$(188): GOTO printl IF MID$(text$, l%, 1) = "J" THEN w$ = CHR$(38): GOTO printl IF MID$(text$, l%, 1) = "K" THEN w$ = CHR$(166): GOTO printl IF MID$(text$, l%, 1) = "L" THEN w$ = CHR$(134): GOTO printl IF MID$(text$, l%, 1) = "M" THEN w$ = CHR$(148): GOTO printl IF MID$(text$, l%, 1) = "N" THEN w$ = CHR$(169): GOTO printl IF MID$(text$, l%, 1) = "O" THEN w$ = CHR$(233): GOTO printl IF MID$(text$, l%, 1) = "P" THEN w$ = CHR$(249): GOTO printl IF MID$(text$, l%, 1) = "Q" THEN w$ = CHR$(142): GOTO printl IF MID$(text$, l%, 1) = "R" THEN w$ = CHR$(176): GOTO printl IF MID$(text$, l%, 1) = "S" THEN w$ = CHR$(31): GOTO printl IF MID$(text$, l%, 1) = "T" THEN w$ = CHR$(63): GOTO printl IF MID$(text$, l%, 1) = "U" THEN w$ = CHR$(237): GOTO printl IF MID$(text$, l%, 1) = "V" THEN w$ = CHR$(94): GOTO printl IF MID$(text$, l%, 1) = "W" THEN w$ = CHR$(29): GOTO printl IF MID$(text$, l%, 1) = "X" THEN w$ = CHR$(64): GOTO printl IF MID$(text$, l%, 1) = "Y" THEN w$ = CHR$(192): GOTO printl IF MID$(text$, l%, 1) = "Z" THEN w$ = CHR$(253): GOTO printl IF MID$(text$, l%, 1) = "1" THEN w$ = CHR$(150): GOTO printl IF MID$(text$, l%, 1) = "2" THEN w$ = CHR$(234): GOTO printl IF MID$(text$, l%, 1) = "3" THEN w$ = CHR$(225): GOTO printl IF MID$(text$, l%, 1) = "4" THEN w$ = CHR$(132): GOTO printl IF MID$(text$, l%, 1) = "5" THEN w$ = CHR$(190): GOTO printl IF MID$(text$, l%, 1) = "6" THEN w$ = CHR$(206): GOTO printl IF MID$(text$, l%, 1) = "7" THEN w$ = CHR$(246): GOTO printl IF MID$(text$, l%, 1) = "8" THEN w$ = CHR$(196): GOTO printl IF MID$(text$, l%, 1) = "9" THEN w$ = CHR$(154): GOTO printl IF MID$(text$, l%, 1) = "0" THEN w$ = CHR$(137): GOTO printl IF MID$(text$, l%, 1) = "+" THEN w$ = CHR$(60): GOTO printl IF MID$(text$, l%, 1) = "-" THEN w$ = CHR$(231): GOTO printl IF MID$(text$, l%, 1) = "*" THEN w$ = CHR$(126): GOTO printl IF MID$(text$, l%, 1) = "/" THEN w$ = CHR$(244): GOTO printl IF MID$(text$, l%, 1) = "=" THEN w$ = CHR$(208): GOTO printl IF MID$(text$, l%, 1) = "?" THEN w$ = CHR$(191): GOTO printl IF MID$(text$, l%, 1) = "!" THEN w$ = CHR$(157): GOTO printl IF MID$(text$, l%, 1) = "@" THEN w$ = CHR$(245): GOTO printl IF MID$(text$, l%, 1) = "#" THEN w$ = CHR$(241): GOTO printl IF MID$(text$, l%, 1) = "$" THEN w$ = CHR$(153): GOTO printl IF MID$(text$, l%, 1) = "%" THEN w$ = CHR$(133): GOTO printl IF MID$(text$, l%, 1) = "&" THEN w$ = CHR$(173): GOTO printl w$ = MID$(text$, l%, 1): GOTO printl printl: IF w$ = "" THEN o% = o% + 1 total$ = total$ + "" IF o% = 15 THEN GOTO printtotal GOTO nextl END IF o% = 0 total$ = total$ + w$ GOTO nextl printtotal: PRINT #2, total$ ' GOTO beginencryption LOOP doneencrypt: PRINT PRINT "Encryption of", file$, "is Complete": PRINT PRINT "Use Decrypt to View this File" PRINT CLOSE END SUB