diff --git a/src/ISAAC-cipher.md b/src/ISAAC-cipher.md new file mode 100644 index 0000000..48638e6 --- /dev/null +++ b/src/ISAAC-cipher.md @@ -0,0 +1,22 @@ +# 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. diff --git a/src/SUMMARY.md b/src/SUMMARY.md index 8e1f2e7..b74cc3d 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -8,7 +8,8 @@ - [DMCA policy](./DMCA-policy.md) - [Privacy policy](./Privacy-policy.md) - [Data](./Data.md) - - [Data-Types](./Data-Types.md) + - [Data-types](./Data-Types.md) + - [ISAAC cipher](./ISAAC-cipher.md) - [Word](./Word.md) - [DWord](./DWord.md) - [QWord](./QWord.md)