Concepts

Network Security Protocols

Cryptographic primitives only help once a protocol decides where to apply them. TLS, IPsec, and secure email each draw the protection boundary in a different place, and that choice determines what they defend and what they leave exposed.

01Where protection lives

Every secure protocol answers one design question: at which layer, and between which two endpoints, is data protected? Lower layers protect more traffic transparently; higher layers protect less but understand it better and can carry it farther.

Application Session / presentation Transport (TCP/UDP) Network (IP) Link S/MIME · OpenPGPprotects a message TLS · SSH · QUICprotects a connectionbetween two sockets IPsec · WireGuardprotects every packet WPA3 · MACsec higher: travels farther,knows the data, per-app lower: transparent to apps,covers all traffic, per-hop
Same cryptography, different boundaries. Defense in depth often stacks them (TLS inside an IPsec tunnel over WPA3).

02TLS as a protocol architecture

TLS sits between an application and TCP (or inside QUIC over UDP) and is really two cooperating sub-protocols. The handshake authenticates the server (and optionally the client), negotiates algorithms, and derives keys. The record layer then fragments application data, protects each record with an AEAD cipher, and numbers them so reordering or replay is detected.

HTTP · SMTP · IMAP · LDAP · MQTT … Handshakeauth · negotiate · keys Alerterrors · close_notify Application datathe payload Record layerfragment → AEAD encrypt + tag → sequence number TCP (or QUIC/UDP)
Applications opt in. Each one must be TLS-aware, which is both TLS's flexibility and its coverage gap.

Two deployment styles exist. Implicit TLS starts encrypted on a dedicated port (HTTPS on 443, IMAPS on 993). STARTTLS begins in plaintext and upgrades, which leaves a window where an active attacker can strip the upgrade offer and force cleartext.

Version history in one line

SSL 2.0 and 3.0 are broken; TLS 1.0 and 1.1 are formally deprecated; TLS 1.2 is acceptable when configured with AEAD suites; TLS 1.3 removes the legacy options entirely. "SSL" survives only as a marketing word.

03IPsec: protecting packets

IPsec works at the network layer, below every application, so it secures all IP traffic between two endpoints without any software changes. It has two protection protocols and two modes, and the combination decides what an observer can still see.

AH Authentication Header

Integrity and origin authentication, including most of the outer IP header. No encryption. Also breaks through NAT. Rarely used today.

ESP Encapsulating Security Payload

Encryption plus integrity of the payload. With AEAD ciphers it does everything most deployments need; it is the de facto default.

Original IP hdr TCP data Transporthost ↔ host IP hdr ESP TCP data ICV Tunnelgateway ↔ gateway new IP ESP IP hdr TCP data ICV encrypted visible integrity check value Tunnel mode hides the real source and destination: observers see only the two gateways.
Transport mode suits end-to-end host links; tunnel mode wraps whole packets and is the basis of site-to-site VPNs.

04IKEv2 and security associations

ESP needs keys and agreed algorithms before the first packet. A security association (SA) is that agreement: one-directional, identified by an SPI number carried in each ESP header, and stored in each peer's database. IKEv2 is the protocol that creates SAs automatically, authenticates peers, and rekeys them before they expire.

InitiatorResponder IKE_SA_INIT · cleartext proposals · DH share · nonce chosen suite · DH share · nonce IKE_AUTH · encrypted identity · cert or PSK proof · traffic selectors identity · proof · first child SA four messages → an IKE SA (control) plus a child SA pair (ESP data, one per direction)
The same DH-then-authenticate pattern as TLS, adapted to peers that are network devices rather than browsers.

Authentication choices matter: pre-shared keys are simple but shared across many devices and vulnerable to offline guessing if weak; certificates scale and can be revoked individually. A newer, smaller alternative, WireGuard, drops negotiation entirely and uses one fixed modern suite, trading agility for a codebase small enough to audit and formally verify.

05Securing email

Email was designed in an era of trusted hosts and still relays messages through several servers that store and forward them. That makes "secure email" two separate problems: protecting each hop, and protecting the message itself.

Sendermail client Outboundserver Inboundserver Recipientmail client TLSSTARTTLSTLS plaintext at rest on every server S/MIME or OpenPGP: encrypted and signed end to end headers (from, to, date, often subject) remain visible either way
Transport security protects the wire; end-to-end security protects the message, even from the mail providers.

Transport layer

STARTTLS between servers is opportunistic and strippable. MTA-STS and DANE let a domain demand authenticated TLS.

Sender authenticity

SPF lists allowed sending IPs, DKIM signs messages per domain, DMARC tells receivers what to do when both fail. These fight spoofing, not snooping.

End to end

S/MIME and OpenPGP encrypt to the recipient's public key and sign with the sender's private key. Strong, but notoriously hard to use.

06Two models of trust

Every public-key protocol must answer "how do I know this key belongs to that name?" The two email standards answer it in opposite ways, and the same split appears elsewhere (TLS uses hierarchy; SSH defaults to trust-on-first-use).

Hierarchical (S/MIME, TLS) Web of trust (OpenPGP) CA trust flows down from a few authorities peers vouch for each other's keys
Hierarchy scales and suits enterprises with an existing PKI; web of trust avoids central authorities but puts verification work on users.

07Side-by-side comparison

TLSIPsec (ESP)S/MIME / OpenPGP
LayerBetween app and transportNetworkApplication (message)
ProtectsOne connectionAll IP traffic between peersOne message, at rest too
AuthenticationX.509 certs; usually server onlyCerts or PSK; both peersCerts or web of trust; sender signs
ConfidentialityYes (AEAD)Yes (AEAD)Yes, end to end
IntegrityPer recordPer packetPer message (signature)
Non-repudiationNoNoYes, with signatures
App changes?Yes, app must use TLSNoneMail client support
NAT / firewall friendlyVeryNeeds NAT-T (UDP 4500)Rides on email
Hides metadata?Not IPs, sizes, often SNITunnel mode hides inner IPsHeaders visible

TLS and IPsec authenticate a channel; only message-level signatures prove who authored the content to a third party.

08Choosing a protocol

Start from the threat and the boundary you need, not from the product.

What must be protected? one appall trafficstored message Users on the web? Sites or devices? Who manages keys? TLS 1.3HTTPS mTLSservice ↔ service IPsec tunnelsite ↔ site IKEv2 / WGremote device S/MIMEorg PKI OpenPGPindividuals Then weigh: performance, interoperability, compliance (HIPAA, PCI DSS), and who will operate it.
Zero-trust designs push toward the left branch everywhere: encrypt and authenticate each service connection, even inside the "trusted" network.

09Pitfalls and misconceptions

A protocol proven secure on paper is only as strong as its implementation and configuration.

Implementation bugs

OpenSSL's Heartbleed and repeated flaws in commercial VPN appliances show that widely deployed code is a single point of failure for millions of hosts.

Downgrade

Any protocol that negotiates can be talked down to its weakest allowed option. Disable legacy versions; don't merely prefer modern ones.

Misconfiguration

AH-only policies, weak PSKs, missing certificate validation, and permissive STARTTLS all pass a casual test while giving little protection.

MythSSL and TLS are the same thing.
RealityTLS replaced SSL, and every SSL version is broken. "SSL certificate" really means X.509 certificate used by TLS.
MythIPsec always encrypts.
RealityAH and null-encryption ESP authenticate without hiding anything. The policy, not the name, decides.
MythMy email is encrypted, so it's private.
RealityUsually that means TLS per hop. Providers can read it, and headers are exposed even with end-to-end encryption.
MythEncryption noticeably slows the network.
RealityWith AES-NI and ChaCha20, symmetric crypto runs at line rate on ordinary CPUs; handshakes are the only real cost.

—References

Peer-reviewed

  1. Bhargavan, K. et al. (2014). Triple handshakes and cookie cutters. IEEE S&P. doi:10.1109/SP.2014.14
  2. Donenfeld, J. (2017). WireGuard: next generation kernel network tunnel. NDSS. doi:10.14722/ndss.2017.23160
  3. Durumeric, Z. et al. (2015). Neither snow nor rain nor MITM. ACM IMC. doi:10.1145/2815675.2815695
  4. Felsch, D. et al. (2018). The dangers of key reuse: practical attacks on IPsec IKE. USENIX Security. usenix.org
  5. Holz, R. et al. (2016). TLS in the wild. NDSS. doi:10.14722/ndss.2016.23055
  6. Poddebniak, D. et al. (2018). Efail. USENIX Security. usenix.org
  7. Whitten, A. & Tygar, J. D. (1999). Why Johnny can't encrypt. USENIX Security. usenix.org

Standards and guidance