Professor Franklin
Accessibility settings

Preferences are saved in this browser when storage is available.

Getting Started

Chapter 7 · Reading 3 of 6

Choosing algorithms for a protected connection

Security+ SY0-801 · Objectives 1.3

Imagine trying to send a sealed envelope to a person you have never met. You need to know whose address you have, how the envelope will remain private and how the recipient will notice tampering. Those are separate questions when a browser first contacts the portal as well.

Start with the vocabulary

  • Transport Layer Security (TLS) protects data in transit for HTTPS, email and many other protocols. TLS 1.2 and 1.3 are current. SSL and early TLS versions are obsolete and should be disabled.
  • A cipher suite is the set of algorithms a connection uses for key exchange, authentication, encryption and integrity.
  • Diffie–Hellman (DH) key exchange lets two parties derive a shared secret over a public network without ever sending it. Ephemeral means a fresh key pair is used for each session and then discarded.
  • Forward secrecy means that stealing a server’s long-term private key later does not let an attacker decrypt sessions recorded earlier.
  • Key length affects strength. AES-128 and AES-256 are both considered strong. RSA needs 2048 bits or more, while elliptic curve keys of 256 bits give comparable strength with much smaller keys.

Follow one message through TLS

A student opens the grade portal. The client first needs confidence that it reached the intended service. The peers then need traffic keys that a passive observer cannot derive. Finally, every application record needs confidentiality and protection against modification. One algorithm rarely supplies all three properties. In a TLS 1.3 trace, look separately at the key share, the certificate signature scheme and the negotiated record protection.

Ephemeral elliptic curve Diffie–Hellman (ECDHE), on a curve such as X25519, lets the endpoints derive a shared secret. The server can authenticate the handshake with a signature such as ECDSA or RSA-PSS. The certificate chain establishes which identity is bound to the verification key. Ephemeral key agreement can provide forward secrecy when ephemeral secrets are erased, limiting the effect of a later compromise of a long-term signing key on recorded sessions.

Figure 1. Three questions in one TLS 1.3 connectionEach is answered by a different mechanism. Avoid putting the same algorithm in every row.
QuestionMechanismExample
Did the client reach the real portal?Certificate chain plus a handshake signatureECDSA or RSA-PSS
How did the peers get traffic keys?Ephemeral key agreement, then key derivationECDHE on X25519
Why accept this record?Authenticated encryption: the tag verifiedAES-GCM, ChaCha20-Poly1305

Select a construction with the required property

AES-GCM and ChaCha20-Poly1305 are authenticated encryption schemes, meaning they provide confidentiality and integrity together. They produce ciphertext and an authentication tag and can authenticate associated data such as a record header. The receiver must verify the tag before accepting plaintext. A nonce is a number used only once. Reusing a nonce with the same key can destroy security. A service that restores a machine image must consider whether its nonce generation state could repeat. Delegate these decisions to an established library and protocol.

SHA-256 produces a fixed-size digest. Anyone who changes a file can compute a new digest, so publish the expected digest through a trusted channel. HMAC (hash-based message authentication code), such as HMAC-SHA-256, authenticates data between parties that share a secret. Either party can create a valid tag. A digital signature allows verification with a public key and keeps signing authority with the private key holder. For stored passwords, use a salted, deliberately expensive password hashing scheme such as Argon2id. A fast general-purpose digest makes large-scale guesses inexpensive.

Figure 2. Hash, HMAC and signature: who can create and who can check
Who can create a valid valueWho can verifyGood for
Hash (SHA-256)AnyoneAnyone with a trusted copy of the expected digestDetecting change
HMAC-SHA-256Anyone holding the shared secretAnyone holding the shared secretIntegrity between two parties
Digital signatureOnly the private key holderAnyone with the public keyProving who approved the bytes

Work through a design review

A backup system encrypts its archive but downloads a checksum beside it from the same untrusted share. Ask who can replace both objects. Verify a signature under a separately trusted release key, restrict access to the decryption key and test recovery after key rotation. Each check addresses a different failure.

TLS 1.3 specification

Explain a trace to the service owner

Take the three observations in the handshake case and finish three different sentences. “The client accepted the server’s identity because …” calls for certificate validation and handshake authentication. “The peers obtained traffic secrets by …” calls for the key agreement and derivation. “The receiver accepted this record because …” calls for successful authenticated decryption under the negotiated keys. If you put the same algorithm in every blank, revisit where its operation occurs. Even a correctly negotiated connection still depends on timely information when an issuer withdraws trust from a certificate. The next reading, Investigating certificate revocation with CRL and OCSP, covers that.

TLS handshake transcript

Inspect the three records, then use the evidence to answer the question.

1. Key agreement

Ephemeral X25519 agreed a shared secret.

2. Signature

ECDSA authenticated the server transcript.

3. Record cipher

AES-128-GCM protected application records.

Apply the reading

Why does a signature check leave a separate need for record protection?

Compare your reasoning

A signature authenticates handshake data. Traffic keys and authenticated encryption protect subsequent application records.