A Layman's Guide to Networking Cryptography

Topics · Published 2019-12-25 · Revised 2026-11-23
Reviewed corrections applied locally; pre-review version preserved separately · Joomla source

4,165 Total views across this article’s versions; includes the historical baseline where available.

This article explains common network cryptographic concepts in plain-English.

Contents

Primary Features of Secure Communications

Secure communication usually combines several properties:

  • Confidentiality: only authorized parties can read the protected content.
  • Integrity: unauthorized changes to protected data can be detected.
  • Authentication: a peer or message can be tied to the identity or key holder the protocol is meant to authenticate.

These properties are related but distinct. Encryption does not automatically authenticate the intended peer, and authentication does not automatically conceal content. A VPN also does not guarantee anonymity. RFC 5116.

Common Authentication Methods

Authentication establishes the identity or credential holder relevant to the protocol. A password demonstrates knowledge of a shared secret; a signature can demonstrate possession of a private key. Neither proof establishes a useful identity unless the verifier knows which credential to trust.

Peer authentication during a handshake differs from the keyed authentication of later packets. Secret keys must remain protected; a public key can be distributed openly. A key’s secrecy, purpose and trustworthy association with an identity are separate questions.

Authenticating with PKI

Public Key Infrastructure (PKI) helps a client bind a public key to an intended identity. For a certificate-authenticated TLS connection, the client validates the server certificate and its chain to a trusted authority, checks the requested service identity, and verifies the server’s proof of possession of the private key.

In TLS 1.3, CertificateVerify is a signature over the handshake context, followed by a Finished message that confirms the handshake keys. This is not a server encrypting an echoed message with its private key. An attacker can also return an echo; the trust binding and cryptographic proof are what matter. RFC 5280; RFC 9525; RFC 8446, Section 4.4.

IPsec Authentication Header (AH)

Authentication Header (AH) is an IPsec protocol providing integrity and data-origin authentication without encryption. It can operate in transport mode as well as tunnel mode. Its coverage includes the payload and immutable or predictable IP-header fields; mutable fields receive the handling specified by the protocol.

AH normally uses a keyed integrity algorithm, not a public-key digital signature. See RFC 4302 and What Is IPsec?.

IPsec Encapsulating Security Payload (ESP)

Encapsulating Security Payload (ESP) can provide confidentiality and integrity, including through an AEAD construction. It also supports integrity-only service. The selected mode and algorithms determine which bytes are encrypted and authenticated. The outer IP header is outside ESP integrity coverage. RFC 4303; What Is IPsec?.

Passwords

A password is a memorized secret, not a token defined as 16 characters or fewer. Its strength depends on unpredictability, length, reuse, storage, rate limits and how it is used. Human-chosen passwords and randomly generated cryptographic keys should not be treated as interchangeable simply because both are secrets.

As a dated example of guidance rather than a universal protocol limit, NIST SP 800-63B-4 requires at least 15 characters for single-factor passwords and allows a minimum of eight when used only as part of multi-factor authentication. It recommends permitting at least 64 characters as the maximum supported length. NIST SP 800-63B-4, Section 3.1.1.2.

Common Encryption Methods

Symmetric encryption uses secret key material shared by the relevant sender and receiver. Public-key cryptography uses mathematically related public and private keys, but its operations depend on the algorithm: encryption, signature verification and key agreement are not the same operation.

A protocol can use public-key techniques to establish and authenticate a session, then symmetric encryption to protect the bulk data. Keys can be established during a handshake or provisioned in advance.

Asymmetric Keys

A public/private key pair has a public part that may be shared and a private part that must be protected. For an encryption scheme, a sender can encrypt to the recipient’s public key and the recipient decrypts with its private key. For a signature scheme, the signer uses its private key and a verifier checks the signature with the public key. A signature is not generally “private-key encryption.” Some key types support signing or agreement rather than encryption.

The public key also needs a trustworthy association with the intended peer. Receiving a key and an echoed message does not supply that association.

A two-way secure connection does not inherently require two public-key pairs for every exchange. TLS can authenticate a server with one certificate and derive separate symmetric traffic keys for each direction; client-certificate authentication is optional. RFC 8446.

PKI

PKI is the collection of roles, policies and mechanisms used to issue, manage and validate public-key certificates. It is not an encryption algorithm or another name for every public/private key operation. Certificates can support authentication in protocols that then derive symmetric traffic keys. RFC 5280.

X.509

X.509 defines a public-key certificate framework. A certificate binds subject information to a public key and includes a signature by its issuer, along with validity information and other fields. The private key is not included in the certificate. RFC 5280, Section 4.

X.509 vs PKI

X.509 is a certificate standard; PKI is the infrastructure and practice that can use such certificates. They are related, not interchangeable terms.

A certificate contains a public key, subject or subject-alternative-name information, an issuer, a validity period and a signature, among other fields. A self-signed certificate does not become trusted merely by having a valid self-signature: the relying party needs an appropriate trust decision. RFC 5280.

How Does X.509 Compare to Public Key Infrastructure (PKI)?

RFC 5280 specifies the Internet profile of X.509 certificates and certificate revocation lists. It does not turn X.509 into a collection of Internet transport protocols. Extensions and later updates refine particular certificate-processing rules.

The issuer’s signature protects the encoded certificate information, including the public-key binding. Usage constraints, names, validity and other certificate fields affect whether that certificate is acceptable for a particular connection. RFC 5280.

Certificate Authorities

A Certificate Authority (CA) issues and signs certificates under its policies. The relying client decides which trust anchors it accepts and validates the presented certificate chain accordingly. The server and client do not need identical trust stores, and a certificate naming an issuer does not force the client to trust that issuer.

A CA is not normally a live decryption intermediary in each TLS handshake. RFC 5280, Section 6.

How Clients Validate CA-Issued Certificates

The CA signs certificate information with its signing private key. The client verifies the signature using the issuer’s public key and builds and validates a certification path to a trust anchor. It also checks applicable validity, constraints, usage and service-identity rules.

Revocation checking can involve a downloaded list or an online status service, depending on the protocol and policy. That is different from sending an encrypted certificate hash to a CA so it can decrypt it and compare it with a master record. Normal certificate-signature verification is performed by the relying party. RFC 5280, Sections 4 and 6; RFC 9525.

Symmetric Keys

Symmetric cryptography uses shared secret key material. A protocol may derive different keys for encryption, authentication and each traffic direction. The fact that both peers can compute the necessary keys does not mean one identical key must be used for every purpose. RFC 7296, Sections 2.14 and 2.17.

Diffie-Hellman Algorithm

Diffie–Hellman (DH) is a key-agreement method. The peers exchange public values, retain their private values, compute a shared secret and derive keys from it. They do not need to send that shared secret over the network.

DH does not encrypt the application message or authenticate the participants by itself. The surrounding protocol must bind the exchange to the intended peers. RFC 7296; RFC 7748.

Pre-Shared Keys

Pre-shared keys are secret material provisioned before the protocol exchange. They can be used for authentication or key derivation according to the protocol. They require a secure provisioning process, sufficient entropy, appropriate scope and protection against disclosure.

PSKs do not universally provide the best protection against a man-in-the-middle. Certificate-based authentication can also be strong when validated correctly, while a weak password used as a PSK can permit guessing attacks. Sharing one PSK among many unrelated clients also changes who can impersonate a peer. RFC 7296, Sections 2.15 and 2.16.

Shared Secrets

A shared secret is information known to the authorized parties and kept secret from others. It may be provisioned in advance or derived through key agreement. A DH shared secret is normally input to a key-derivation function, not automatically the final encryption key. Protocols commonly derive multiple purpose-specific and direction-specific keys from it.

Hybrid Systems

Hybrid encryption conventionally combines public-key techniques for establishing or transporting key material with symmetric encryption for bulk data. For example, an authenticated ephemeral-DH handshake can establish traffic keys used with an AEAD cipher.

That is different from multi-factor authentication, which combines different kinds of authentication factors. A certificate exchange followed by a password prompt is not, by itself, the definition of hybrid encryption or proof that independent authentication factors were used. RFC 8446; NIST SP 800-63B-4.

Key Exchange Agreements

Key establishment includes agreeing or transporting secret key material and negotiating the parameters needed to use it. Public handshake messages can be safe when the protocol authenticates them and the underlying cryptography is sound.

Simply exchanging public keys or performing anonymous DH does not defeat a man-in-the-middle. The peers need a trust mechanism that binds the exchange to the intended identities. Nor does adding a second exchange inside an already compromised connection automatically repair the first one. RFC 7296; RFC 8446.

Diffie-Hellman

Diffie–Hellman is named for Whitfield Diffie and Martin Hellman. It lets participants derive shared-secret material without sending the resulting secret directly. It is key agreement, not payload encryption. Ephemeral private values can help provide forward secrecy when the complete authenticated protocol and secret deletion are handled correctly. RFC 7296, Section 2.12.

IKE/IKEv2

IKEv2 authenticates peers and establishes and maintains Security Associations for IPsec. Its base specification is RFC 7296 (2014), following RFC 4306 (2005) and RFC 5996 (2010). IKEv1 is a different, now-deprecated predecessor; IKE remains the family name.

IKEv2 normally begins with IKE_SA_INIT and IKE_AUTH, then uses CREATE_CHILD_SA and INFORMATIONAL exchanges when needed. It does not call separate ISAKMP, Oakley and SKEME modules to execute universal Phase 1 and Phase 2 steps. Those names explain IKEv1’s historical design lineage.

IKE ordinarily uses UDP port 500 and UDP port 4500 for NAT traversal. NAT detection is explicitly part of IKEv2; MOBIKE is a separately negotiated extension. The IPsec user traffic is carried by ESP or AH. An “IKEv2 VPN” normally means this combined IKEv2/IPsec system.

strongSwan is an IPsec implementation, not an unrelated VPN protocol that merely copied IKE. SCTP is a separate transport protocol; it does not mean TCP on ports 1021 and 1022. RFC 9395; RFC 9260.

MOBIKE (MOBile IKE)

MOBIKE stands for IKEv2 Mobility and Multihoming Protocol. It lets the addresses associated with an IKEv2 SA and its tunnel-mode IPsec SAs change, for example when a client changes networks. It requires support and negotiation by the endpoints and does not provide a separate user-data tunnel by itself. RFC 4555.

KINK (Kerberized Internet Negotiation of Keys)

Kerberized Internet Negotiation of Keys (KINK) manages IPsec SAs using Kerberos-based authentication and keying. It is an alternative key-management protocol, not IKE’s two phases renamed. Its normal SA setup can use a request and response after the necessary Kerberos credentials have been obtained.

KINK relies on the Kerberos trust infrastructure and reachability appropriate to that deployment. It does not inherently require a human to type a password for every connection: cached credentials or keytabs can support unattended services. Whether it suits a network depends on that infrastructure, not a blanket prohibition on Internet use. RFC 4430; MIT Kerberos keytab documentation.

Kerberos

Kerberos is a network authentication protocol using tickets and a trusted Key Distribution Center (KDC). In a conventional deployment, the KDC provides an Authentication Service (AS) and a Ticket-Granting Service (TGS). Applications still make authorization decisions about what an authenticated principal may do.

Kerberos does not operate as a generic application server asking the client to decrypt an echoed password challenge. A client can obtain initial credentials using a key derived from a password or another supported authentication mechanism. Services can use keytabs containing long-term keys, and clients can cache tickets and their associated session keys. RFC 4120; MIT keytab documentation; MIT credential-cache documentation.

Why/When to Use Kerberos

Kerberos is useful when multiple services share an authentication infrastructure and users or services should reuse valid credentials without repeatedly entering or transmitting a password. Cross-realm arrangements can extend that trust to other realms.

Kerberos authentication does not automatically encrypt every application message. The application must use an appropriate message-protection mechanism, such as Kerberos/GSS-API services or another secure channel. Whether a mobile app or website should use it depends on the deployment; it is not a universal replacement for all login methods. RFC 4120.

How Does Kerberos Solve This Problem?

A simplified Kerberos exchange is:

  1. The client obtains a ticket-granting ticket (TGT) and a client/TGS session key from the AS. In a password-based flow, the client’s long-term key is derived from its password; the reply does not send the password.
  2. The client presents the TGT and an authenticator to the TGS to request credentials for a service.
  3. The TGS returns a service ticket and a client/service session key. The service ticket is protected with the service’s key.
  4. The client presents that ticket and a fresh authenticator to the service. The service validates them and can provide mutual authentication.

The client need not retain a plaintext password after obtaining credentials, but Kerberos cannot guarantee that every application or operating system immediately erases every copy. Cached tickets and session keys remain sensitive; a stolen credential cache or keytab can enable impersonation. RFC 4120, Sections 1.1 and 3; MIT credential-cache documentation.

Multi-factor authentication is a separate design choice. An SMS code is not known only to two devices, and it does not reliably defeat malware or real-time phishing. NIST treats telephone-network out-of-band authentication as restricted and distinguishes it from phishing-resistant authentication. NIST SP 800-63B-4, Sections 3.1.3 and 3.2.5.

Perfect Forward Secrecy

Forward secrecy protects past sessions against later compromise of long-term authentication secrets, assuming the protocol used suitable ephemeral secrets and erased them. It is not synonymous with “a new key,” a short lifetime, or a separate SKEME stage.

How PFS Works

An authenticated ephemeral-DH exchange produces shared material from temporary private values. The protocol derives traffic keys and deletes obsolete secrets so that a later long-term-key compromise does not reconstruct earlier sessions from a recorded transcript.

In IKEv2, the initial Child SA derives from the initial IKE DH exchange. A later CREATE_CHILD_SA exchange can add fresh DH input for greater independence from existing IKE keying material. It does not require replacing every original IKE key each time a Child SA is created. Rekeying without new DH still uses fresh nonces; it is not simply reuse of the same traffic key. RFC 7296, Sections 2.12 and 2.17.

Footnotes

  1. NAT means Network Address Translation. IKEv2’s NAT traversal is specified in RFC 7296, Section 2.23, with UDP-encapsulated ESP defined by RFC 3948.
  2. SCTP means Stream Control Transmission Protocol. RFC 9260 (2022) replaced RFC 4960. SCTP is not TCP on two special ports. Its use with IPsec does not make SCTP a built-in IKE transport.