Sir_Warwick, you just have to strip off the "FLS1" and then xor the remaining data bytes with the array of values created by the procedure I gave.
Here is the source code of my 'reference' version of the en/decoder. It computes the xor values on the fly instead of looking them up in a table but the result is the same. The language is FoxPro.
<pre><font size=1 face=Courier>
* Genesis.prg
* 2003-04-16
*
* "Genesis - In the beginning Yahweh created the heavens and the earth."
lparameters cText, rcResult
local o, c, k
rcResult = ""
for o = 0 to len(m.cText) - 1
c = asc(substr(m.cText, 1 + m.o, 1))
k = (asc(substr("Gene", 1 + m.o % 4, 1)) + m.o) % 256
rcResult = m.rcResult + chr(bitxor(m.c, bitor(0x80, m.k)))
next o
return m.rcResult </font></pre>
Note: the substr() function in Fox uses index 1 to address the first character in a string, and you have to qualify memory variables with "m." if you use them within expressions. Apart from that the code should be pretty self-explanatory.
P.S.: now that I look at the stuff it seems that I misremembered the proper way of generating the lookup table. Sorry.
Shows the value of posting verified code snippets instead of prose, though.
Edited by - Sherlog on 02-06-2003 23:50:41