_________SWAT MAGAZINE ISSUE TWENTY FIVE JANUARY 2000 __________ / \___________________________________________/ \ / ShaneCrypt \ / by Odysseus \ ----------------------------------------------------------------------- (Note- this is a old version of the code...at present it is much better I.E. the code is cleaner... it can crypt any file type..blah blah... so don't email me bout it k? :P ) Ok I'll make this brief.. Shanecrypt is at present in the beta stage, there are many many ideas yet to be implemented, Shancrypt for now is basicly just an engine, but it wont take to much hard work to write your own algors for it. The purpose of me building SC is to learn as I go along.. So far it will only crypt anscii files NOT binarys, Im working on the ASM code for this as we speak. Shancrypt is dedicated to the family dog Shane that passed away on 22th of july 1999, may his memory live forever in this here code :). There ais a small prob, it won't copy files with more than 3 letter extensions. Thanks for trying out SC and if you find any faults or have any surgestions please email me at :- ukhg@btinternet.com or check the HDC site at :- www.hdcuk.cjb.net for my email addy incase it has changed (damn all the spammers). -Odysseus Part of the HDCrew (SWAT has been given exclosive rights to distribute this article) ----------------------------snip------------------------------------------------------ {Andrew Rose, "ShaneCrypt" is for the use of well.. Crypting shite... } { } { } {Copyright (C) 1999 Andrew R (UK) } { } {This program is free software; you can redistribute it and/or modify } {it under the terms of the GNU General Public License as published by } {the Free Software Foundation; version 2 of the License. } {This program is distributed in the hope that it will be useful, } {but WITHOUT ANY WARRANTY; without even the implied warranty of } {MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the } {GNU General Public License for more details. } { } {You should have received a copy of the GNU General Public License } {along with this program; if not, write to the Free Software } {Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA } { } { You can contact the coder at :- ukhg@btinternet.com } program Shanecrypt(input,output); uses crt; Var option : char; { These are our global varibles that will } exit : char; { be used by both the encrypt and decrypt } sfile : string; { procedures } tfile : text; tofile : text; cchar : char; pw : longint; acon : integer; errorcode: integer; procedure efinishup; Begin assign(tfile, 'temp.dat'); { This lil bit copys whats in the temp back to } reset(tfile); { the file thats been crypted, then rewrites( } assign(tofile, sfile); { wipes) the temp file } rewrite(tofile); While Not eof(tfile) Do Begin While Not eoln(tfile) Do Begin read(tfile, cchar); write(tofile, cchar); end; writeln(tofile); readln(tfile); end; rewrite(tfile); close(tofile); close(tfile); End; procedure dfinishup; Begin assign(tfile, 'temp.dat'); { This lil bit copys whats in the temp back to } reset(tfile); { the file thats been decrypted, then rewrites(} assign(tofile, sfile); { wipes) the temp file } rewrite(tofile); While Not eof(tfile) Do Begin While Not eoln(tfile) Do Begin read(tfile, cchar); write(tofile, cchar); end; writeln(tofile); readln(tfile); end; rewrite(tfile); close(tofile); close(tfile); End; Procedure abo; begin gotoxy(27,6); write('------------------------'); gotoxy(27,7); write('| |'); gotoxy(27,8); write('| ShaneCrypt |'); gotoxy(27,9); write('| ver 0.0.1 |'); gotoxy(27,10); write('| |'); gotoxy(27,11); write('| Coder - Odysseus |'); gotoxy(27,12); write('| |'); gotoxy(27,13); write('| |'); gotoxy(27,14); write('| |'); gotoxy(27,15); write('| www.hdcuk.cjb.net |'); gotoxy(27,16); write('------------------------'); readln; end; Procedure hep; begin write('See the read me file'); end; Procedure dec; Begin clrscr; Write('What ya wanna decrypt m8?: '); readln(sfile); write('Enter a number ranging from 0-90999: '); read(pw); assign(tfile, sfile); {$I-} reset(tfile); {$I+} errorcode := IOResult; if ErrorCode <> 0 then writeln('Problem opening input file!'); assign(tofile, 'temp.dat'); rewrite(tofile); While Not eof(tfile) Do Begin While Not eoln(tfile) Do Begin read(tfile, cchar); { Take alook at the enc procedure belows comments, they } acon := (ord(cchar)); { apply to this but our decrypting instead } {this is the begining of our algor} acon := acon + 1; acon := acon - pw; {this be the end of our algor} cchar := (chr(acon)); write(tofile, cchar); end; writeln(tofile); readln(tfile); end; close(tofile); close(tfile); dfinishup; { Jumps to the finish up procedure that tranfers the data and cleans the temp } End; Procedure enc; Begin clrscr; Write('What ya wanna crypt m8?: '); readln(sfile); write('Enter a number ranging from 0-90999: '); read(pw); assign(tfile, sfile); { Getting the file ready that we are gonna crypt} {$I-} reset(tfile); { Opening the file thats gonna be crypted } {$I+} errorcode := IOResult; If ErrorCode <> 0 then writeln('Problem opening input file!'); assign(tofile, 'temp.dat'); { Getting the temp file ready for storage of the crypted outcome} rewrite(tofile); { Wiping the temp and opening it } While Not eof(tfile) Do { checking to see if we are at eof of the file to be crypted } Begin While Not eoln(tfile) Do { checking to see if we are at eoln of file to be crypted } Begin read(tfile, cchar); { reading character into the cchar char varible } acon := (ord(cchar)); { finding the characters ascii value } {this is the begining of our algor} acon := acon - 1; { taking 1 away from the anscii value } acon := acon + pw; { adding what ever was specified for the pw } {this be the end of our algor} cchar := (chr(acon)); { finding out what our modifyed ascii value be and writing it back to cchar } write(tofile, cchar); { writing our modifyed(crypted) character to the temp file } end; writeln(tofile); { starting a new line in the temp if eoln is found } readln(tfile); { starting a new line to read from the file we are cypting if eoln is found } end; close(tofile); { closes the temp file } close(tfile); { closes the read file } efinishup; { Jumps to the finish up procedure that tranfers the data and cleans the temp } End; Begin {Main Menu} TextColor(Green); TextBackground(Black); clrscr; gotoxy(27,6); write('------------------------'); gotoxy(27,7); write('| |'); gotoxy(27,8); write('| ShaneCrypt |'); gotoxy(27,9); write('| ver 0.0.1 |'); gotoxy(27,10); write('| |'); gotoxy(27,11); write('| Presented By |'); gotoxy(27,12); write('| The |'); gotoxy(27,13); write('| HDC Krew |'); gotoxy(27,14); write('| |'); gotoxy(27,15); write('| www.hdcuk.cjb.net |'); gotoxy(27,16); write('------------------------'); gotoxy(27,18); {Begining proccedd function} write('Do wish to proceed Y/N?'); readln(exit); If (exit = 'y') then Begin {Menu Selection} clrscr; gotoxy(27,7); write('------------------------'); gotoxy(27,8); write('| Menu |'); gotoxy(27,9); write('|----------------------|'); gotoxy(27,10); write('| |'); gotoxy(27,11); write('| 1 Encrypt File |'); gotoxy(27,12); write('| |'); gotoxy(27,13); write('| 2 Decrypt File |'); gotoxy(27,14); write('| |'); gotoxy(27,15); write('| 3 Help! |'); gotoxy(27,16); write('| |'); gotoxy(27,17); write('| 4 About |'); gotoxy(27,18); write('------------------------'); gotoxy(27,21); write(' What do you wish to do?'); {reading case option and performing outcome} readln(option); Case option of '1' : enc; '2' : dec; '3' : hep; '4' : abo; else clrscr; gotoxy(34, 11); writeln('Whos dog?'); readln; end; {case end} End{ending If's begin statment} else If (exit = 'n') then clrscr; gotoxy(21, 11); writeln('Thank you for wasting some time looking at'); gotoxy(21, 12); writeln(' ShaneCrypt the neXT gen of encryption!'); readln; End.