fffffffArd
This commit is contained in:
parent
b52a72e5a4
commit
56aeb213a6
24740
javascript/classes.js
24740
javascript/classes.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -2,7 +2,6 @@ package net.lax1dude.eaglercraft;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@ -173,7 +172,6 @@ public class WebsocketNetworkManager implements INetworkManager {
|
||||||
}else {
|
}else {
|
||||||
DataInputStream packetStream = new DataInputStream(new ByteBufferDirectInputStream(stream));
|
DataInputStream packetStream = new DataInputStream(new ByteBufferDirectInputStream(stream));
|
||||||
while (stream.hasRemaining()) {
|
while (stream.hasRemaining()) {
|
||||||
if(logpackets)System.out.println("FARD");
|
|
||||||
stream.mark();
|
stream.mark();
|
||||||
try {
|
try {
|
||||||
Packet pkt = Packet.readPacket(packetStream, false);
|
Packet pkt = Packet.readPacket(packetStream, false);
|
||||||
|
@ -186,8 +184,9 @@ public class WebsocketNetworkManager implements INetworkManager {
|
||||||
if(logpackets)System.out.println("RECEIVING: " + pkt);
|
if(logpackets)System.out.println("RECEIVING: " + pkt);
|
||||||
pkt.processPacket(this.netHandler);
|
pkt.processPacket(this.netHandler);
|
||||||
if(change){
|
if(change){
|
||||||
processReadPackets();
|
//processReadPackets();
|
||||||
return;
|
//return;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (EOFException e) {
|
} catch (EOFException e) {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
|
||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -34,6 +36,7 @@ public class Packet250CustomPayload extends Packet {
|
||||||
* Abstract. Reads the raw packet data from the data stream.
|
* Abstract. Reads the raw packet data from the data stream.
|
||||||
*/
|
*/
|
||||||
public void readPacketData(DataInputStream par1DataInputStream) throws IOException {
|
public void readPacketData(DataInputStream par1DataInputStream) throws IOException {
|
||||||
|
if(!Minecraft.getMinecraft().gameSettings.useDefaultProtocol) {
|
||||||
this.channel = readString(par1DataInputStream, 20);
|
this.channel = readString(par1DataInputStream, 20);
|
||||||
this.length = par1DataInputStream.readShort();
|
this.length = par1DataInputStream.readShort();
|
||||||
|
|
||||||
|
@ -42,6 +45,7 @@ public class Packet250CustomPayload extends Packet {
|
||||||
par1DataInputStream.readFully(this.data);
|
par1DataInputStream.readFully(this.data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract. Writes the raw packet data to the data stream.
|
* Abstract. Writes the raw packet data to the data stream.
|
||||||
|
|
|
@ -83,24 +83,4 @@ public class RSA {
|
||||||
s += "modulus = " + modulus;
|
s += "modulus = " + modulus;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
int N = Integer.parseInt(args[0]);
|
|
||||||
RSA key = new RSA(N);
|
|
||||||
System.out.println(key);
|
|
||||||
|
|
||||||
// create random message, encrypt and decrypt
|
|
||||||
BigInteger message = new BigInteger(N-1, random);
|
|
||||||
|
|
||||||
//// create message by converting string to integer
|
|
||||||
// String s = "test";
|
|
||||||
// byte[] bytes = s.getBytes();
|
|
||||||
// BigInteger message = new BigInteger(bytes);
|
|
||||||
|
|
||||||
BigInteger encrypt = key.encrypt(message);
|
|
||||||
BigInteger decrypt = key.decrypt(encrypt);
|
|
||||||
System.out.println("message = " + message);
|
|
||||||
System.out.println("encrypted = " + encrypt);
|
|
||||||
System.out.println("decrypted = " + decrypt);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user