protected byte[] encryptHeader(ref byte[] header) { string dtKey = DateTime.UtcNow.ToString("yyyyMMddHH"); rc4Cipher = new XRC4Cipher(dtKey); return(rc4Cipher.DoCipher(ref header)); }
public Server(Socket socket) { this.ClSocket = socket; this.Buffer = new byte[PacketStream.MaxBuffer]; this.Data = new PacketStream(); this.InCipher = new XRC4Cipher(Program.RC4Key); this.OutCipher = new XRC4Cipher(Program.RC4Key); }
public Client(Socket socket) { this.ClSocket = socket; this.Ip = ((IPEndPoint)socket.RemoteEndPoint).Address.ToString(); this.Port = ((IPEndPoint)socket.RemoteEndPoint).Port; this.Buffer = new byte[PacketStream.MaxBuffer]; this.Data = new PacketStream(); this.InCipher = new XRC4Cipher(Program.RC4Key); this.OutCipher = new XRC4Cipher(Program.RC4Key); }