The client probably has RSA enabled, replace your doKeys method in the stream class with this:
Code:
public void doKeys() {
int i = currentOffset;
currentOffset = 0;
byte abyte0[] = new byte[i];
readBytes(i, 0, abyte0);
BigInteger biginteger2 = new BigInteger(abyte0);
BigInteger biginteger3 = biginteger2/*.modPow(biginteger, biginteger1)*/;
byte abyte1[] = biginteger3.toByteArray();
currentOffset = 0;
writeWordBigEndian(abyte1.length);
writeBytes(abyte1, abyte1.length, 0);
}
Or, preferably, enable RSA server-sided, google and try to find Nikki's tut.