Key yeah sure,
More interested in the packet formats though.
opcode,size,format,name,info about the packet etc
Edit:
Is there a way to keep just 1 in/out cryption module loaded..
Not 1 each player.
Its easy to make the keys static already fixt that.. if i wanted to.
But then still as for each player it still needs there own count..
So is there a way to like.. make the key update to the new count.
I'm thinking if i can recode the cryption module a bit so i can select what pase it was at for the cur player.
Edit2:
Seems it just counts down from 255 to 0 then 255 again..
Wow seems i forgot it reGenerates the keyset.. damn.
Gone check what changes :p lol
Edit3:
Well it seems all possible,
I just have to store the crypt values for each client.
And update the crypt for each packet its quite easy.
Its not 2 crypts per client in/out.
Its then 1 crypt that gets 1 random key on server startup.
The client gets 1 little edit that disabled the random generation for the client key.
Could base it on the server key or just use the server key twice ?
That is what I'm doing atm.
So its like this
server startup>gen key>init crypt>get incomming connections etc etc etc..
Now the server sends the key that got gen the client sends well i guess a key we can ignore.. as its the server key twice ?
set the crypt values for the client in/out values.
just change the function to accept extra values and let it use those :p.
easy right ?
startup read these values when calling crypt set these vars.
then when done store them again so its ready for the next crypt :).
Code:
public int keyArrayIdx = 0;
public int keySetArray[] = null;
public int cryptArray[] = null;
public int cryptVar1 = 0;
public int cryptVar2 = 0;
public int cryptVar3 = 0;
Edit Again?:
Btw guys i need info about the packetSize array.
Is the client array the same for the server and handled the same?
As i see this being used in server
Code:
static int packetSizes[256] = {
0, 0, 0, 1, -1, 0, 0, 0, 0, 0, //0
0, 0, 0, 0, 8, 0, 6, 2, 2, 0, //10
0, 2, 0, 6, 0, 12, 0, 0, 0, 0, //20
0, 0, 0, 0, 0, 8, 4, 0, 0, 2, //30
2, 6, 0, 6, 0, -1, 0, 0, 0, 0, //40
0, 0, 0, 12, 0, 0, 0, 0, 8, 0, //50
0, 8, 0, 0, 0, 0, 0, 0, 0, 0, //60
6, 0, 2, 2, 8, 6, 0, -1, 0, 6, //70
0, 0, 0, 0, 0, 1, 4, 6, 0, 0, //80
0, 0, 0, 0, 0, 3, 0, 0, -1, 0, //90
0, 13, 0, -1, 0, 0, 0, 0, 0, 0,//100
0, 0, 0, 0, 0, 0, 0, 6, 0, 0, //110
1, 0, 6, 0, 0, 0, -1, 0, 2, 6, //120
0, 4, 6, 8, 0, 6, 0, 0, 0, 2, //130
0, 0, 0, 0, 0, 6, 0, 0, 0, 0, //140
0, 0, 1, 2, 0, 2, 6, 0, 0, 0, //150
0, 0, 0, 0, -1, -1, 0, 0, 0, 0,//160
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //170
0, 8, 0, 3, 0, 2, 0, 0, 8, 1, //180
0, 0, 12, 0, 0, 0, 0, 0, 0, 0, //190
2, 0, 0, 0, 0, 0, 0, 0, 4, 0, //200
4, 0, 0, 0, 7, 8, 0, 0, 10, 0, //210
0, 0, 0, 0, 0, 0, -1, 0, 6, 0, //220
1, 0, 0, 0, 6, 0, 6, 8, 1, 0, //230
0, 4, 0, 0, 0, 0, -1, 0, -1, 4,//240
0, 0, 6, 6, 0, 0 //250-255
};
And this in the client
Code:
public static final int[] packetSizes = {
0, 0, 0, 0, 6, 0, 0, 0, 4, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, -2, 4, 3, 0, 0, 0,
0, 0, 0, 0, 5, 0, 0, 6, 0, 0,
9, 0, 0, -2, 0, 0, 0, 0, 0, 0,
-2, 1, 0, 0, 2, -2, 0, 0, 0, 0,
6, 3, 2, 4, 2, 4, 0, 0, 0, 4,
0, -2, 0, 0, 7, 2, 0, 6, 0, 0,
0, 0, 0, 0, 0, 0, 0, 2, 0, 1,
0, 2, 0, 0, -1, 4, 1, 0, 0, 0,
1, 0, 0, 0, 2, 0, 0, 15, 0, 0,
0, 4, 4, 0, 0, 0, -2, 0, 0, 0,
0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 0, 14, 0, 0,
0, 4, 0, 0, 0, 0, 3, 0, 0, 0,
4, 0, 0, 0, 2, 0, 6, 0, 0, 0,
0, 3, 0, 0, 5, 0, 10, 6, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, -1, 0, 0, 0,
4, 0, 0, 0, 0, 0, 3, 0, 2, 0,
0, 0, 0, 0, -2, 7, 0, 0, 2, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2, -2, 0, 0, 0, 0, 6, 0, 4, 3,
0, 0, 0, -1, 6, 0, 0
};
So if that is correct!
-1 = unknown non-static
0 = well no extra? not used?
1+ = packet size ?
EDIT YAY!??:
Well it seems the cryption works perfectly :).
Just have to make it send crypted opcodes :).
decrypting recieved codes works i think!