
Originally Posted by
SlickEashy
So here's what I got so far from looking at the K Relay source:
- There is an empty 4 bytes at the beginning of the packet for god knows what reason.
- The fifth byte is the packet ID.
- I've been doing strings in ASCII but Kronk has been doing them in UTF8, I don't know if there is much of a difference between those but I will switch to UTF8.
- I encrypt the whole packet with the RC4 cipher and decrypt all the data in all incoming packets with the same cipher but a different key.
- All the numbers that are written are in network order (big endian).
For the love of god, please correct me if I'm wrong.
First four bytes aren't empty, they're the length of the packet.
UTF8 is the correct string format, there would be big issues if you didnt use it.
You need two ciphers, one for each key, seperate instances. The RC4 cipher has a state so what it has decrypted beforehand changes its output and internal state, so you must always use the correct one for incomming and outgoing packets.
Yeah you need to convert to to whatever order the network is currently using.