public static void InitRC4(Message Msg, Session Session) { string Key = Msg.Read<string>(); if (!Session.Crypto.InitializeRC4(Key)) return; fuseResponse.New(Opcodes.OpcodesOut.SendPublicKey); fuseResponse.Append<string>(Session.Crypto.GetPublicKey.ToString()); Session.SendPacket(fuseResponse); }
public static void InitCrypto(Message Msg, Session Session) { Session.Crypto = new HabboCrypto(Engine.N, Engine.E, Engine.D); String Token = new BigInteger(DiffieHellman.GenerateRandomHexString(15), 16).ToString(); Engine.BannerTokenValues.Add(Token, Session.Crypto.GetPrime.ToString() + ":" + Session.Crypto.GetGenerator.ToString()); fuseResponse.New(Opcodes.OpcodesOut.SendToken); fuseResponse.Append<string>(Token); fuseResponse.Append<bool>(false); Session.SendPacket(fuseResponse); }