The firewall determines which inside services can be accessed from the outside, which outsiders are permitted access to the permitted inside services, and which outside services can be accessed by insiders. For a firewall to be effective, all traffic to and from the Internet must pass through the firewall, where it can be inspected. The firewall must permit only authorized traffic to pass, and the firewall itself must be immune to penetration. A firewall system cannot offer any protection once an attacker has gotten through or around it. Even if both access control and authentication security systems are completely effective, the enterprise can still be at risk when data communications travel over a third-party network such as the Internet.
Encryption is used to protect against eavesdropping.
It renders information private by making it unreadable to all except those who have the key needed to decrypt the data. Both or all parties possess a previously distributed key that locks and unlocks the data. Public key encryption. One party possesses a private unlocking key and makes a public locking key. Secure key exchange.