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); }
public PacketIn Decrypt(CryptKey Key, byte[] packet) { PacketIn Packet = new PacketIn(packet, 0, packet.Length); Packet = Packet.DecryptMythicRC4(Key.GetbKey()); return Packet; }
public byte[] Crypt(CryptKey Key, byte[] packet) { packet = PacketOut.EncryptMythicRC4(Key.GetbKey(), packet); return packet; }