- To protect yourself from man-in-the-(MITM) attacks, you should use traffic encryption in public networks. You can do this by using virtual private networks (VPNs), a public key infrastructure (PKI), digital certificates and a certification authority. They help protect documents sent and authenticate users by encrypting messages. A PKI is an infrastructure where the communicating parties trust a certification authority to verify their identities.