示例#1
0
        private void SynchronizeCryptoMessage(NetworkIncomingMessage message)
        {
            HandshakeKey decryptor = keys.Remote.Clone();

            byte[] synchronize = HandshakeCryptoPayload.GetVerification();

            byte[] encrypted = decryptor.Encrypt(synchronize, 0, synchronize.Length);
            int    offset    = Bytes.Find(message.ToBytes(), encrypted);

            message.Acknowledge(offset);
            connection.Receive(MeasureCryptoMessage, HandshakeCryptoPayload.MinimumSize);
        }
 public void Encrypt(DataBlock block)
 {
     key.Encrypt(block);
 }
示例#3
0
 public void ToBytes(DataBlock block)
 {
     inner.ToBytes(block);
     key.Encrypt(block);
 }