At least from the networking perspective, it's a solved problem. You assume the network is insecure, and encrypt the traffic.
This can be done on the protocol level, or wrapping the protocol with a secure shell like SSL/TLS, or wrapping everything with an encrypted VPN tunnel like IPSec.