From: Stefan Kaczmarek <stefan_at_thezonie.org>
Date: Wed, 6 Jun 2007 21:13:07 -0700


Ok, so we're gonna do this encryption madness.

I guess we're just going to use that GetRand() func that you sent me
a while back? Where you plug in the int and then get a different byte
out and XOR it with the data? We'll do that for the UDP, which is
coolio, and I guess also for the app receiving the sources, and the
app sending the index hashses.

Now, should we just totally encrypt the entire JSON string? Or just
the elements of the JSON elements? Because it's between the app and
the server, we can prolly just do the whole thing, so that the JSON
structure is also obscured. We can either include the key value as
another post element or something.

So, if you've got code for this already, can you send me the before
and afters of a string or two, so that I can test it with my Java stuff?

My func looks like this:

for(int i=4;i<ret.length;i++)
        k = k * 1103515245 + 12345;
        b=(byte)((key/65536) % 256);
        ret[i] ^= b;

Where k is the key and the ret[] array is the data. b is obviously
the next byte. I just do that in a loop. Java doesn't know unsigned,
and yours used to mod it with 32768. Those are really the only
changes I did.

Fun times.

- Z
Received on Fri Sep 14 2007 - 10:55:51 BST

This archive was generated by hypermail 2.2.0 : Sun Sep 16 2007 - 22:19:45 BST