ISAAC

From RuneWiki
Jump to navigationJump to search

Introduction

ISAAC is a psuedo random number generator designed by Robert Jenkins that is cryptographically secure. The name is an acronym for 'increment, shift, accumulate, add and count' which refers to the set of operations in the code itself. This type of PRNG is known as a stream cipher. It is used to cryptographically secure a stream of data by doing a reversible operation on any known byte or byte sequence using a pseudo-random result generated by ISAAC or another stream cipher.

Packet opcode encryption

The ISAAC is used in the client to encrypt and decrypt packet opcodes. The ISAAC ciphers are set up with the same seeds both client and server side and therefore have the same internal state.

When a packet is sent, the next random number in the ISAAC is added to the opcode. This prevents proxy programs such as AutoRune from knowing what the true opcode of a packet is. When a packet is received, the next random number in the equivalent ISAAC is subtracted from the opcode, which gives the original opcode again, allowing the packet to be processed as normal.

To protect the seeds from a proxy program such as AutoRune, RSA is used to encrypt the login block.

Links

Source

They essentially just modified this implementation and used the ISAACAlgorithm class. Note that if you want to use this one as well, you need to set the "flag" variable true. When ZKM obfuscated their ISAAC class, it removed the if statement since the flag was a constant (atleast that's my theory), making that code always execute.