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
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 ...