/// <summary> /// Initializes the encryption of client. /// </summary> internal void InitializeEncryption(string nonce) { RC4Encrypter sendEncrypter = new RC4Encrypter(LogicMagicMessageFactory.RC4_KEY, nonce); RC4Encrypter receiveEncrypter = new RC4Encrypter(LogicMagicMessageFactory.RC4_KEY, nonce); this._messaging.SetEncrypters(sendEncrypter, receiveEncrypter); }
/// <summary> /// Processes this instance. /// </summary> internal override void Process() { RC4Encrypter ReceiveEncrypter = (RC4Encrypter)this.Device.ReceiveEncrypter; RC4Encrypter SendEncrypter = (RC4Encrypter)this.Device.SendEncrypter; string Nonce = Rjindael.ScrambleNonce((uint)this.Seed, this.Nonce); ReceiveEncrypter.Init(Factory.RC4Key + Nonce); SendEncrypter.Init(Factory.RC4Key + Nonce); }
/// <summary> /// Sets the encrypters. /// </summary> internal void SetEncrypters() { this.Crypto = new RC4Encrypter(LogicLifeMessageFactory.RC4Key); }