Encryption by Steve I. Meredith ------------------------------- How the program Works The idea behind the actual encryption is simple. Take a number, eg. $7C, we'll take this number as being a secret message (Hmm?). Take another number, $66, we'll call this the passcode. Now XOR $7C and $66 to produce $1A. Now NOT $1A to give -$E5 (or $FFFFFFE5) ones comp. So, we have combined our secret message and a passcode along with the XOR and NOT functions to produce a new code altogether. We'll call this our FileCode. Now note the following ; [NOT] $FFFFFFE5 = $1A $1A [XOR] $66 = $7C (back to our original code) and likewise ; $1A [XOR] $7C = $66 Thus, given number A and B. XORing these two numbers gives C. If we know one number, B we can always get back to A by XORing with C. This is the principle applied to many protection packages on the market. The program Encryption uses this method and a little more for the users convenience. The program is invoked from AmigaDOS by the command : "CRYPT passCode1 PassCode2 Filename" eg. "CRYPT 123 hello MyFile" The program then checks 'MyFile' to see if it is already encrypted. If it isn't, then the Two passCodes are combined to produce a unique DiskCode. This code is then used to XOR and NOT every WORD in the stipulated file. Example take an ASCII text file before encryption ; 0000: 68656C6C 6F2C2074 68697320 69732073 hello, this is s 0010: 6F6D6520 73616D70 6C652064 61746120 ome sample data 0020: 28612074 65787420 66696C65 29206265 (a text file) be 0030: 666F7265 20490A45 6E637279 70742069 fore I.Encrypt i 0040: 742E2020 41732079 6F752063 616E206F t. As you can o 0050: 6276696F 75736C79 20736565 2C206974 bviously see, it 0060: 27732072 65616461 626C6520 286F720A 's readable (or. 0070: 6973206D 7920456E 676C6973 68207468 is my English th 0080: 61742062 61643F29 2E0A at bad?).. we invoke the Encryption with "Crypt fred 123b Myfile.txt" - The program works and overwrites the file with the new Encrypted version of the file. After encryption ; 0000: 43727970 742D3220 28632920 A9AEB4A9 Crypt-2 (c) .... 0010: F3FFE1F5 F4B6ADED F3F3FEB9 F2E9ADEA ................ 0020: F4F7E8B9 E8FBE0E9 F7FFADFD FAEEECB9 ................ 0030: B3FBADED FEE2F9B9 FDF3E1FC B2BAEFFC ................ 0040: FDF5FFFC BBD387DC F5F9FFE0 EBEEADF0 ................ 0050: EFB4ADB9 DAE9ADE0 F4EFADFA FAF4ADF6 ................ 0060: F9ECE4F6 EEE9E1E0 BBE9E8FC B7BAE4ED ................ 0070: BCE9ADEB FEFBE9F8 F9F6E8B9 B3F5FF93 ................ 0080: F2E9ADF4 E2BAC8F7 FCF6E4EA F3BAF9F1 ................ 0090: FAEEADFB FAFEB2B0 B590 .......... When you want the file back to its original state, simply use the same passwords ; "Crypt fred 123b Myfile.txt" If however you use the wrong passCodes, then the program will abort telling you that you're using incorrect keys to gain access. This is done by comparing various file-stored infomation embeded within the encrypted file. What the program can cater for ; * Will do all files EXE or text etc. * Will detect write protected disk * Will detect lack of parameters * Will detect incorrect pass words * Will cope with lack of memory (although not tried with meg up grade. Any letters/Alterations and general stuff to me at ... 74 Pemberton Road Winstanley Wigan WN3 6DA or 28 Seaton Street Middlesbrough Clevelnd TS1 3N