Form1 KTEncode Form15w Command2 Decode Text2 Command1 Encode Text1 Terminal Label1 Password Command1_Click command1 Caption Text2 first third text1 Form_Load GetIt StartPass EndPass SelText\ SelStart SelLength DecodeH strng Encodee text3 Picture1 CountIt Robot\ Adjust Command2_Click CounIt break SUCCESS Text1_Change TheTextt Applyj KTEncrypt PASSWORD EncodeDecode AllowError Looper TotalAscii AllDoneK Loop1 Loop2 NotYet NotYeyt AdjustCount ToChange Count Addin@ Counts ErrorLevV KTEncrpyt ErrorFlag Finction` KTEncode2 Errors ThenErrors ThenMsgBox Flag255 reverse coding Check1 Check2 original ErrorCapture ErrorHandler INVALID Command3_Click Command4_Click Command1_Click Encode Text1 Errors?? KTEncrypt Error Command2_Click Decode text1 Errors?? KTEncrypt Error Form_Load Line feed A message Hello, This is a demonstration program of the KTEncrpyt Function. Any text in this text box will be encrypted based on a password entered above. Type in a password of at least one character then press Encode. You will see a transformed text that is impossible to decifer. Keeping the password the same, press the decode button and see the file restored. Try it again but before Decoding change the password and see what happens. Either you get a 'INVALID PASSWORD' error or you just get a bunch of useless text. Feel free to use this Function as you please. The only restriction is if you pass it on please distribute the orignal unmodified files in a ZIP format. If you find it usefull or have questions or comments send them to: K & T Karl D Albrecht P.O. Box 478 San Lorenzo, CA 94580-0478 or Send E-Mail to America Online -> KARL25 (KARL25@AOL.COM) Please read the READTHIS.TXT file for programming information KTEncrypt Programmed by Karl Albrecht (KARL25@AOL.COM) Dimension the Adjust array Set error capture routineo Preserve original string Check for errors (Errorcodes are custom) Is there Password??t Is there a strng$ to work with? Check to see if it is an encoded file if encoding warn! If decoding warn Create a four part encryption code based on password First Adjust code based on length of passwordn If first character ascii code even make adjust negative Second Adjust code based on first and last character ascii codes Third code based on average of all ascii codes Fourth code based on previous threeb Now check if any Adjust codes are zero If it is zero make it not zero (any number is fine!) Now check if any adjusts are the sameu Don't compare same items Check for a matchh Make sure we didn't make it zero Encode or deocde Loop until scanned though the whole file Add to Looper Keep Adjust code Counts from 1 to 4 Get the character to change ENCODE Flag%=0 If adjustment to high or low then reverse the coding and add in a chr$(255) to mark the changee If adjustment OK then just cahnge the charactero DECODE Flag% <> 0 If find a CHR$(255) then remove it and set Flag255% to ensure reverse codes on next pass reverse coding Since CHR$(255) was removed we need to back up Looper and Counts because characters all shifted to the left If not CHR$(255) then decode watching if Flag255% is set Set function equal to changed string Tack on CHR$(255) to end so it can be recognized as encoded Make sure Errors$ is cleared Illegal Function Call --> out of range ASCII codex INVALID PASSWORD! Is there Password?? NO PASSWORD! Is there a strng$ to work with?= NO STRING! Encoding a encoded file? FORCE FILE ALREADY ENCODED! Decoding a non-encoded file? FORCE FILE NOT ENCODED! Unanticipated