Lesson 1 of 3 Secure Protocols and PKI

Secure Protocols and Their Use Cases

Secure protocols apply cryptography to communication. This lesson explains IPsec, TLS, S/MIME and DKIM, which protocol fits common use cases, and the limitations and vulnerabilities that practitioners must manage.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe IPsec protocols and modes.
  • Describe TLS and its current versions.
  • Distinguish S/MIME and DKIM.
  • Choose protocols for common use cases and identify their limitations.

IPsec

Internet Protocol Security (IPsec) protects traffic at the network layer, so it can secure any application without changes. It has two main protocols. The Authentication Header (AH) provides integrity and authentication of packets but no encryption, and it is incompatible with NAT. The Encapsulating Security Payload (ESP) provides confidentiality as well as integrity and authentication, and it is the protocol used in practice.

IPsec operates in two modes. Transport mode protects the payload of each packet between two hosts, leaving the original IP header visible. Tunnel mode encrypts the entire original packet and wraps it in a new IP header, so it is used between gateways for site-to-site VPNs and for many remote access VPNs. Internet Key Exchange (IKE), version 2 today, authenticates the peers (with certificates or pre-shared keys) and negotiates security associations, the agreed algorithms and keys.

Sort into groups

Transport or tunnel mode?

Exam skills 5.3.1

Decide which IPsec mode each statement describes.

Log in to try this activity Interactive activities are free with an account.

TLS

Transport Layer Security (TLS) secures connections between applications, most visibly HTTPS, but also email transfer (SMTP with STARTTLS), directory access (LDAPS), file transfer (FTPS) and many APIs. In a TLS handshake, the server presents its certificate, client and server agree on keys (with ephemeral ECDHE in TLS 1.3, giving forward secrecy) and then protect data with authenticated symmetric encryption. Mutual TLS adds a client certificate.

TLS 1.3 (2018) removed obsolete features and weak ciphers, made forward secrecy mandatory and shortened the handshake. TLS 1.2 remains acceptable with strong cipher suites. SSL 2.0, SSL 3.0, TLS 1.0 and TLS 1.1 are deprecated.

S/MIME and DKIM

Email needs protection beyond the connection between servers. Secure/Multipurpose Internet Mail Extensions (S/MIME) signs and encrypts individual messages using X.509 certificates issued to users. A signature proves who sent the message and that it was not altered; encryption with the recipient's public key keeps it confidential end to end, even on mail servers. Both parties need certificates, which limits its use to organisations that deploy them.

DomainKeys Identified Mail (DKIM) works at the domain level. The sending mail server signs selected headers and the body of outgoing messages with the domain's private key, and receiving servers verify the signature using a public key published in the sender's DNS. DKIM shows that a message really came from the domain and was not modified in transit, which helps fight spoofing and phishing. It does not encrypt messages. DKIM works with SPF (Sender Policy Framework), which lists the servers allowed to send for a domain, and DMARC, which tells receivers what to do with messages that fail and sends reports.

The following comparison summarises the four protocols.

IPsec
LayerNetwork
ProtectsAll IP traffic between endpoints or gateways
Typical useSite-to-site and remote access VPNs
TLS
LayerTransport/session, below applications
ProtectsIndividual application connections
Typical useHTTPS, secure APIs, mail transfer
S/MIME and DKIM
LayerApplication (email messages)
ProtectsS/MIME: individual messages end to end; DKIM: domain authenticity of messages
Typical useSigned and encrypted email; anti-spoofing

The following diagram shows how the three controls work together.

How SPF, DKIM and DMARC let receiving servers reject phishing that claims the company's domain. SPF lists the authorised sending servers, DKIM signs legitimate outgoing mail, and DMARC, eventually set to reject, tells receivers to discard messages that fail aligned checks and to send reports. None of them encrypts mail.
The policy setting shown is the eventual target.

Common use cases

The SSCP outline names five use cases. The following table shows the usual protocol choices.

Use caseTypical protection
Credit card processingTLS 1.2+ for transmission, plus tokenisation or encryption of stored card data under PCI DSS; point-to-point encryption from card readers
File transferSFTP (over SSH) or FTPS (FTP over TLS), or HTTPS-based managed file transfer; never plain FTP
Web clientHTTPS with TLS 1.2 or 1.3, valid certificates and HSTS
Virtual private networkIPsec (IKEv2) or TLS-based VPNs, with MFA for users
Transmission of PIITLS for transport, plus message- or file-level encryption (S/MIME, PGP, encrypted archives) when data passes through intermediaries or must stay protected at rest

A key distinction is hop-by-hop versus end-to-end protection. TLS protects each connection; data is decrypted at each server it passes through. S/MIME and PGP protect the message itself from sender to recipient.

Match the pairs

Protocols by use case

Exam skills 5.3.1 · 5.3.2

Match each use case with the secure protocol that suits it.

Log in to try this activity Interactive activities are free with an account.

Limitations and vulnerabilities

Secure protocols are only as secure as their versions, configuration and certificates. Old versions have known attacks, such as POODLE against SSL 3.0 and BEAST against TLS 1.0, and attackers attempt downgrade attacks to force their use. Weak cipher suites, short keys and missing forward secrecy reduce protection. Certificate problems (expired, self-signed, mismatched names) train users to ignore warnings, which enables man-in-the-middle attacks. Implementation flaws, such as Heartbleed in OpenSSL, require prompt patching of cryptographic libraries.

Protocols also have inherent limits. Encryption in transit does not protect data at rest at either end, or from a compromised endpoint. TLS inspection proxies decrypt traffic, creating a sensitive point that must itself be protected. IPsec can be blocked by firewalls and complicated by NAT (NAT traversal encapsulates it in UDP 4500). DKIM proves the domain, not the individual sender, and does not encrypt. Configuration should be checked regularly with scanning tools.

Select all that apply

Protocol weaknesses

Exam skills 5.3.3

Identify configuration weaknesses in secure protocols.

Log in to try this activity Interactive activities are free with an account.
Worked example

Choosing protection

A payroll provider must send monthly files containing employee bank details to a client. The files pass through the client's file gateway and are stored there for a week. What protection is appropriate?

Use SFTP or FTPS so that the transfer is encrypted, and also encrypt the files themselves, for example with PGP using the client's public key, so that they stay protected at rest on the gateway and only the intended recipients can decrypt them. TLS alone would protect only the connection, not the stored files.

Worked example

Spoofed email

Customers receive phishing emails that appear to come from the company's domain. Which controls help receiving servers reject them?

Publish an SPF record listing authorised sending servers, DKIM-sign all legitimate outgoing mail, and publish a DMARC policy, eventually set to reject, so that receivers discard messages that fail SPF and DKIM alignment and send reports. These protect the domain's reputation; they do not encrypt mail.

Check yourself

Which IPsec protocol provides confidentiality?

Show answer

The Encapsulating Security Payload (ESP); the Authentication Header provides integrity and authentication only.

Exam Tips

Remember for the exam

  • ESP encrypts; AH does not. Tunnel mode suits site-to-site VPNs.
  • Use TLS 1.2 or 1.3; disable SSL and TLS 1.0 and 1.1.
  • DKIM signs at the domain level; S/MIME protects messages end to end; TLS is hop by hop.