Terminal services error with Realtek network drivers under Windows
If you've found this page, it's probably because, like me, you have an issue which causes terminal services/remote desktop to randomly disconnect with the error "Because of error in data encryption, this session will end." when connecting to a PC using a Realtek network adapter/motherboard networking chipset. If you aren't using any such drivers, my solution is unlikely to help you, and you may be suffering a router related issue instead, so check Microsoft's forums/knowledge base for a solution.
For me the PC that produced this issue when connecting to it was running Windows XP x64 with an ABIT IP-35 Pro motherboard which uses the Realtek 8110SC chipset for networking, but other products/Windows versions may well be prone to this problem too. It took me some time experimenting with different network configurations to trace the cause of this problem, anyway - to cut a long story short here is...
The solution
Open device manager (control panel/system/hardware tab/device manager) and open the properties page for the network adapter you're using. Open the advanced tab, select the "Offload TCP_LargeSend" property and disable it. Push OK (your network connections will be disabled and reconnected as the change is applied). This change solved the issue for me.
Further details
It seems that the problem is caused by a bug in the Realtek drivers which sometimes corrupts data when TCP offloading for large frames is switched on (basically this uses network hardware to do some processing instead of the main processor for oversized TCP/IP frames, which should increase performance slightly in theory). This data corruption causes remote desktop to disconnect with an error message, and seems to occur most frequently when first connecting (presumably because a large amount of data is sent at once).
I didn't notice any issues with turning this feature off, but it might have more of a performance impact if you're running a server or something that's sending/receiving huge amounts of network traffic constantly.