home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
UTILITIE
/
TANGLE30.ZIP
/
ALGTHM.TXT
next >
Wrap
Text File
|
1990-05-08
|
1KB
|
30 lines
For each block, let us call it page[x,y] where 0<=x<wide and 0<=y<high:
(it is understood that each line is for all x<wide and for all y<high)
-----------------------------------------------------------------------
1) Do one shuffle:
page[x,y] := page[x,(y+key[x]) mod high]
if y is odd then page[x,y] := (page[x,y] XOR page[x,y-1])+1 mod 256
page[x,y] := page[(x+(y mod (wide-1))+1) mod wide,y]
2) Perform a simple substitution:
page[x,y] := page[x,y] XOR ((x*high+y)*7 mod 512)
3) Do 9 shuffles:
page[x,y] := page[x,(y+key[x]) mod high]
if y is odd then page[x,y] := ((page[x,y]-1 mod 256) XOR page[x,y-1])
page[x,y] := page[(x+(y mod (wide-1))+1) mod wide,y]
Each step in the process is easily reversible.
-------------------------------------------------------------------------
The encrypted file format is:
1) Three decimal integers: program version number (= 3), wide, high.
Each as chars terminated by a comma (i.e. C format "%d,%d,%d,").
2) for each block:
The real number of characters in the block as a comma
terminated decimal integer (i.e. C format "%d,").
The block of bytes:
for (j:=0..high-1), for (i:=0..wide-1) page[i,j]
-------------------------------------------------------------------------