/// <summary>
        /// Encrypt am outgoing message with this algorithm;
        /// no writing can be done to the message after encryption,
        /// or message will be corrupted.
        /// </summary>
        public override bool Encrypt(NetOutgoingMessage message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            int payloadBitLength = message.BitLength;
            int numBytes         = message.ByteLength;
            int blockSize        = BlockSize;
            int numBlocks        = (int)Math.Ceiling(numBytes / (double)blockSize);
            int dstSize          = numBlocks * blockSize;

            message.EnsureBitCapacity((dstSize + 4) * 8); // add 4 bytes for payload length
            message.BitPosition = 0;

            Span <byte> buffer        = _buffer.AsSpan();
            Span <byte> messageBuffer = message.GetBuffer().AsSpan();

            for (int i = 0; i < numBlocks; i++)
            {
                Span <byte> messageSlice = messageBuffer[(i * blockSize)..];