23 lines
1.1 KiB
Markdown
23 lines
1.1 KiB
Markdown
|
# ISAAC cipher
|
||
|
|
||
|
ISAAC is a cryptographically secure pseudorandom number generator, and a stream cipher designed by Robert J. Jenkins Jr (see [ISAAC](http://burtleburtle.net/bob/rand/isaacafa.html)).
|
||
|
|
||
|
You can find the standard Java implementation used [here](https://github.com/PureCS/rs317-client/blob/master/src/com/runescape/client/io/ISAACCipher.java).
|
||
|
|
||
|
## ISAAC instance creation
|
||
|
When a client logs into the server, two instances of ISAAC are created,
|
||
|
and the generated seeds are transmitted between them.
|
||
|
One instance is for encryption, and one for decryption.
|
||
|
|
||
|
The seed is comprised of 128-bits, half is generated by the client, and
|
||
|
half by the server.
|
||
|
This is to ensure that no individual entity has entire control of
|
||
|
the key generation process.
|
||
|
|
||
|
## Use in the client
|
||
|
ISAAC is used to encrypt and decrypt packet opcodes before transmission, to make packet manipulation harder.
|
||
|
|
||
|
When a packet is sent, its opcode becomes the original opcode added to the generated ISAAC opcode from the encryption instance.
|
||
|
|
||
|
The packet opcode is decrypted analogously on the server.
|