Exemplo n.º 1
0
        public bool AddCrypt(string name, CryptKey CKey, CryptKey DKey)
        {
            ICryptHandler Handler = Server.GetCrypt(name);

            if (Handler == null)
            {
                return(false);
            }

            if (CKey == null)
            {
                CKey = Handler.GenerateKey(this);
            }

            if (DKey == null)
            {
                DKey = Handler.GenerateKey(this);
            }

            Log.Debug("Crypt", "Add crypt : " + name);

            if (m_crypts.ContainsKey(Handler))
            {
                m_crypts[Handler] = new CryptKey[] { CKey, DKey }
            }
            ;
            else
            {
                m_crypts.Add(Handler, new CryptKey[] { CKey, DKey });
            }

            return(true);
        }
Exemplo n.º 2
0
 public PacketIn Decrypt(CryptKey Key, byte[] packet)
 {
     PacketIn Packet = new PacketIn(packet, 0, packet.Length);
     Packet = Packet.DecryptMythicRC4(Key.GetbKey());
     return Packet;
 }
Exemplo n.º 3
0
        public byte[] Crypt(CryptKey Key, byte[] packet)
        {
            packet = PacketOut.EncryptMythicRC4(Key.GetbKey(), packet);

            return packet;
        }