Every systems engineer needs tools to serve his daily needs at work. These tools do not necessarily come from vendors, they can be done by hand,
specially when there is a need for custom ones. One of the tools I needed lately is a TCP client/server application, with the server part running
as a Windows service and securely accepting connections from the client part, while serving multiple purposes. Well, the subject itself is not new.
How many TCP client/server examples are there around on the web? Countless! It was really easy given that I already have the TcpListener and TcpClient
in hand. Once I grabbed the idea, I was able to come out with some sort of an Echo server in less than an hour (experienced programmers could have
done that in minutes :)), but that would never be used. Why? Not because it lacks functionality, but just because it lacks SECURITY. Yes, Telnet-like
programs are no option, specially when you will run them on a production server.
So, I went for the obviously obvious option: cryptography with the .NET CryptoStream. Or, did I? :)