IsaacCipher

Server Side

public void writeHeader(ISAACCipher cipher, int value) {
			int next = cipher.getNextKey();
			writeByte(value + next);
		}
// Set up the ISAAC ciphers.
			long clientHalf = in.readLong();
			long serverHalf = in.readLong();
			int[] isaacSeed = { (int) (clientHalf >> 32), (int) clientHalf, (int) (serverHalf >> 32), (int) serverHalf };
			setDecryptor(new ISAACCipher(isaacSeed));
			for (int i = 0; i < isaacSeed.length; i++) {
				isaacSeed[i] += 50;
			}
			setEncryptor(new ISAACCipher(isaacSeed));

Client side

int opcode = inputStream.readByte() & 0xff;
				opcode = opcode - decryption.getNextKey()&0xff;
serverSeed = inputStream.readLong();
					int[] seed = new int[4];
					seed[0] = (int) (Math.random() * 99999999D);
					seed[1] = (int) (Math.random() * 99999999D);
					seed[2] = (int) (serverSeed >> 32);
					seed[3] = (int) serverSeed;
					encryption = new IsaacCipher(seed);
					for (int i = 0; i < 4; i++) {
						seed[i] += 50;
					}
					decryption = new IsaacCipher(seed);

There’s something wrong with decryption.getNextKey()

This is my first time implementing it so I could’ve made a beginners mistake

[quote]There’s something wrong with decryption.getNextKey()
[/quote]
Useful. What is exactly wrong? Is it crashing? Is it doing something it should not be doing? Is the result not what is expected?

Coming in and dumping code and saying “it’s not working” is utterly useless.

Read this before posting.

I’m sorry, I already fixed this. The problem was that the outcome was wrong/gave the wrong opcode.
The problem was sending the seeds after I created the decryption.