Beispiel #1
0
        // checks if key is connected with hwid
        public bool Valid(string key)
        {
            if (!_authenticated)
            {
                throw new Exception("Connection not encrypted");
            }

            var data = SendAndReceive($"3|{key.AESEncrypt(_aesKey)}|{HardwareId.GetHwid().AESEncrypt(_aesKey)}");

            return(bool.Parse(data[1].AESDecrypt(_aesKey)));
        }
Beispiel #2
0
        public RequestState Register(string key)
        {
            if (!_authenticated)
            {
                throw new Exception("Connection not encrypted");
            }

            var data = SendAndReceive($"4|{key.AESEncrypt(_aesKey)}|{HardwareId.GetHwid().AESEncrypt(_aesKey)}");

            return((RequestState)int.Parse(data[1].AESDecrypt(_aesKey)));
        }