Example #1
0
        public static void Process(ClientSocket clientSocket, MsgDH packet)
        {
            var b = packet.GetPayload();

            clientSocket.Diffie.HandleResponse(Encoding.ASCII.GetString(b));
            clientSocket.Crypto = new Crypto(clientSocket.Diffie.Key);
            clientSocket.Send(MsgLogin.Create("asd", "asdasd", false, MsgLoginType.Login));
        }
        public static void Process(ClientSocket clientSocket, MsgDH packet)
        {
            var b = packet.GetPayload();

            clientSocket.Diffie = new DiffieHellman(256).GenerateResponse(Encoding.ASCII.GetString(b));
            clientSocket.Send(MsgDH.Create(clientSocket.Diffie.ToString()));
            clientSocket.Crypto = new Crypto(clientSocket.Diffie.Key);
        }