YourNextCert™ with Shubham Sharma

Chapter 7

PKI and Cryptographic Applications

Public key cryptography, hashing and digital signatures, PKI and certificates, key management, real-world uses such as TLS, S/MIME, PGP and IPsec, emerging applications and the main cryptanalytic attacks.

Status
In progress
Last updated

Video

The video for this chapter is not available yet.

Exam domains and objectives covered

Domain 3: Security Architecture and Engineering

  • 3.5 Assess and mitigate the vulnerabilities of security architectures, designs, and solution elements
  • 3.6 Select and determine cryptographic solutions
  • 3.7 Understand methods of cryptanalytic attacks

Objectives are numbered as in the official ISC2® CISSP exam outline.

Learning objectives

By the end of this chapter you should be able to:

  • Use public and private keys correctly for encryption and for signatures
  • Compare ECC, RSA, ElGamal and Diffie–Hellman, and explain the impact of quantum computing
  • Recall hash function requirements and digest lengths, and explain salting and key stretching for password storage
  • Describe how digital signatures and HMAC provide integrity, authentication and nonrepudiation
  • Explain how a PKI enrols, validates and revokes certificates, and recognise certificate types and formats
  • Apply key management practices such as rotation, backup and hardware security modules
  • Apply cryptography to portable devices, email, web traffic and network connections
  • Recognise cryptanalytic and implementation attacks and their defences

Key topics

  • Asymmetric key usage
  • RSA, Diffie–Hellman, ElGamal and ECC
  • Quantum and post-quantum cryptography
  • Hash functions (SHA-2, SHA-3)
  • Salting and key stretching
  • Digital signatures and HMAC
  • PKI and certificates
  • Key management
  • TLS, S/MIME, PGP, IPsec
  • Cryptanalytic attacks

Chapter notes

Chapter overview

Symmetric cryptography is fast but struggles with one problem: how do strangers agree on a shared key? Public key (asymmetric) cryptography solves it, and the public key infrastructure (PKI) lets millions of parties trust each other’s keys. This chapter covers the asymmetric algorithms, hashing and digital signatures, how certificates are issued and checked, how all of this appears in everyday technology, and how attackers try to break it.

Key concepts

Which key does what

Goal Key used
Encrypt a message for someone Their public key
Decrypt a message sent to you Your private key
Sign a message Your private key
Verify someone’s signature Their public key

Public keys can be shared openly; private keys never leave their owner (except under a controlled escrow or recovery arrangement). Asymmetric keys must be much longer than symmetric keys for the same strength.

Equivalent strength Key length
Symmetric (for example AES) 128 bits
RSA 3,072 bits
Elliptic curve 256 bits

Asymmetric algorithms

  • RSA (1977): its strength comes from how hard it is to split a huge number back into its two prime factors. The public key is a modulus and an exponent; the private exponent is derived from the secret primes. Use at least 2,048-bit keys today.
  • Diffie–Hellman: lets two parties derive the same secret over an open channel without ever sending it. It’s a key agreement method, not encryption. Ephemeral versions (DHE, ECDHE) generate fresh values per session and give perfect forward secrecy: stealing a server’s long-term key later doesn’t expose past sessions.
  • ElGamal (1985): extends Diffie–Hellman into a full encryption system; it was never patented, but its ciphertext is twice the size of the plaintext.
  • Elliptic curve cryptography (ECC): relies on a hard problem over points on an elliptic curve; equivalent strength with much shorter keys, which suits mobile and IoT devices.
  • Merkle–Hellman knapsack: an early design broken in 1984; recognise the name only.

Quantum computing

A sufficiently large quantum computer could solve factoring and discrete logarithm problems efficiently, breaking RSA, Diffie–Hellman, ElGamal and ECC. Symmetric ciphers and hashes are weakened far less; longer keys compensate. Two responses:

  • Post-quantum cryptography: new classical algorithms believed to resist quantum attack. NIST published its first standards in 2024 (FIPS 203 for key establishment, FIPS 204 and 205 for signatures). Because adversaries can harvest now and decrypt later, data that must stay secret for many years needs migration planning now.
  • Quantum key distribution (QKD): uses quantum physics to share keys so that eavesdropping is detectable. It’s distance-limited, needs specialised hardware and is used only in niche deployments. The exam outline lists it under PKI.

Hash functions

A cryptographic hash turns input of any length into a fixed-length digest, is quick to compute, is one-way and is collision-resistant. Even a one-character change produces a completely different digest, but the digests give no clue how different two messages are.

Algorithm Digest length (bits) Status
MD5 128 Broken (practical collisions); avoid
SHA-1 160 Deprecated; browsers stopped accepting SHA-1 certificates in 2017
SHA-2 family 224, 256, 384, 512 Current; SHA-224 and SHA-384 are truncated forms of SHA-256 and SHA-512
SHA-3 (Keccak) 224, 256, 384, 512 Current; different internal design, same output sizes as SHA-2
RIPEMD-160 160 Still considered secure; used in Bitcoin addresses. RIPEMD-256 and -320 are longer, not stronger
HAVAL 128–256 Variable-length MD5 variant
HMAC Depends on the hash used Keyed hash for integrity and authentication

Password storage: a plain hash is open to rainbow tables (precomputed hashes). Add a unique random salt per password so each needs its own table, and use deliberately slow key stretching algorithms such as PBKDF2, bcrypt, scrypt or Argon2.

Digital signatures

  1. The sender hashes the message (for example with SHA-256).
  2. The sender encrypts that digest with their private key; the result is the signature.
  3. The recipient applies the sender’s public key to the signature to recover the digest, then compares it with their own hash of the received message.

A match proves integrity (the message is unchanged), authentication of origin (only the private key holder could sign) and nonrepudiation (a third party can verify it too). A signature alone gives no confidentiality; to add it, encrypt the signed message with the recipient’s public key. Signatures also authenticate software downloads and patches (code signing).

HMAC combines a hash with a shared secret key. It proves integrity and that the sender knew the key, faster than a signature, but because both sides hold the key it cannot provide nonrepudiation.

The US Digital Signature Standard (FIPS 186-5) approves RSA, ECDSA and EdDSA signatures, used with approved SHA-2 or SHA-3 hashes.

PKI and certificates

A digital certificate is a public key bound to an identity and signed by a certificate authority (CA). Certificates follow the X.509 standard and contain the version, serial number, signature algorithm, issuer, validity period, subject name and the subject’s public key (plus extensions). They can identify users, devices, email addresses or code publishers. A wildcard certificate (*.example.com) covers one level of subdomain only.

  • CAs are trusted third parties; browsers and operating systems ship with a list of trusted roots. A CA that issues certificates carelessly can lose that trust entirely.
  • Registration authorities (RAs) verify identities for the CA but don’t issue certificates.
  • The root CA is usually kept offline; it signs intermediate CAs, which issue everyday certificates. Validating a certificate means following this chain of trust up to a trusted root.
  • Organisations may run an internal CA with its own root that only internal systems trust.
  • Validation levels: domain validation (DV) proves control of a domain; organisation (OV) and extended validation (EV) add checks on the legal entity.
  • Certificate pinning associates a host with an expected key or certificate so unexpected changes can be detected.

Lifecycle:

Stage What happens
Enrolment Prove your identity, submit a certificate signing request (CSR) containing your public key; the CA signs and returns the certificate
Verification Check the CA’s signature, that you trust the CA, the validity dates, that it isn’t revoked, and that it actually contains the details you rely on
Revocation Needed if the private key is compromised, the certificate was mis-issued, details change or the holder’s affiliation ends

Revocation checking: CRLs (lists of revoked serial numbers, downloaded periodically, so there’s a delay), OCSP (real-time status query: good, revoked or unknown) and OCSP stapling (the server fetches a signed, time-stamped OCSP response and sends it with its certificate, cutting load on the CA). A CA’s certification practice statement (CPS) describes how it operates, including how quickly it handles revocation.

Common file formats: DER (binary; .der, .cer, .crt), PEM (Base64 text; .pem, .crt), PFX/PKCS#12 (binary, may include the private key; .pfx, .p12) and P7B (text; .p7b). A .crt file could be either binary or text.

Key management practices

  • Prefer published, peer-reviewed algorithms; distrust “secret algorithm” products.
  • Generate keys from strong randomness and choose lengths that balance security and performance.
  • Keep private keys private: one exposure compromises everything that key protects, past and future, and allows impersonation.
  • Rotate keys on a schedule to limit the damage from undetected compromise.
  • Back up keys securely or use escrow; a lost private key can mean lost data.
  • Use hardware security modules (HSMs), from USB security keys to enterprise and cloud HSMs, to generate, store and use keys without exposing them, often with hardware acceleration and tamper resistance.

Hybrid cryptography combines both worlds: asymmetric methods establish a random ephemeral session key, symmetric encryption protects the bulk data, and the key is discarded afterwards.

Cryptography in practice

Portable devices: full-disk or volume encryption (BitLocker, FileVault, VeraCrypt) protects lost laptops; a Trusted Platform Module (TPM) stores disk encryption keys and releases them only to an unmodified, authenticated boot, so a removed drive is unreadable elsewhere. Phones and tablets need equivalent policies.

Email: choose protection by need. Encrypt for confidentiality; sign for integrity, authentication and nonrepudiation; do both when you need everything.

  • PGP / OpenPGP uses a web of trust (users vouch for each other’s keys) and modern algorithms.
  • S/MIME uses X.509 certificates from CAs and is built into major enterprise mail clients; webmail support is weaker.

Web: TLS (successor to the insecure SSL) secures HTTPS. In TLS 1.3 the client and server agree a session key with ephemeral (EC)Diffie–Hellman, the server proves its identity by signing the handshake with the private key matching its certificate, and the data is then protected with an authenticated symmetric cipher. TLS 1.3 removed static RSA key exchange, so forward secrecy is always on, and its cipher suites name only the AEAD cipher and hash (for example TLS_AES_256_GCM_SHA384). Treat TLS 1.2 as the minimum and prefer 1.3. SSL 3.0 and TLS 1.0/1.1 are deprecated; the POODLE attack exploited fallback to SSL 3.0. TLS is a protocol, not an algorithm, so the negotiated ciphers matter too.

Tor routes traffic through at least three relays using layered (“onion”) encryption, so no single relay knows both the source and the destination; it also hosts anonymous hidden services.

Steganography hides data inside other files, typically by changing the least significant bits of image or audio samples. It can smuggle data out, and it also underpins legitimate digital watermarking that traces leaked copies.

Networks:

  • Link encryption encrypts everything, including headers, between two points; each hop must decrypt to route, which is slower. It usually operates at lower OSI layers.
  • End-to-end encryption protects the payload from sender to recipient but leaves routing headers visible. It usually operates at higher layers (TLS, SSH).
  • SSH replaces Telnet, rlogin and FTP with encrypted equivalents (SSH-2 only; SSH-1 is insecure).
  • IPsec builds secure channels at the network layer. Authentication Header (AH) provides integrity, origin authentication and replay protection; Encapsulating Security Payload (ESP) adds confidentiality as well as integrity for the payload. Transport mode protects only the payload between hosts; tunnel mode encapsulates the whole packet, typically between gateways. Each security association (SA) is one-way, so a two-way link needs two SAs (four if using both AH and ESP).

Emerging applications

  • Blockchain: a distributed, tamper-evident ledger; first used for cryptocurrency, also proposed for land registries and supply-chain tracking.
  • Lightweight cryptography: algorithms and hardware for low-power or low-latency settings such as sensors, smartcards and satellites.
  • Homomorphic encryption: computing on encrypted data so that the decrypted result matches the result on the plaintext, protecting privacy during processing.

Attacks on cryptography

Attack What the attacker has or does
Brute force Tries every key; each extra key bit doubles the effort. Rainbow tables and specialised hardware speed it up
Ciphertext only Has only ciphertext; frequency analysis works against simple ciphers (if common letters are unchanged, suspect transposition; otherwise substitution)
Known plaintext Has matching plaintext and ciphertext
Chosen plaintext Can encrypt plaintext of their choice; differential cryptanalysis is an example
Chosen ciphertext Can decrypt chosen ciphertext and studies the results
Analytic / statistical Exploits mathematical weaknesses or poor randomness
Implementation Exploits flaws in how the algorithm was coded or built rather than the maths
Side-channel Observes power use, electromagnetic emissions, sound or processor activity
Timing A side channel measuring how long operations take
Fault injection Induces faults (voltage spikes, heat, radiation) to make a device leak secrets
Meet-in-the-middle Defeats double encryption by working from both ends; why Double DES was abandoned
Man-in-the-middle (on-path) Sits between parties, running separate sessions with each
Birthday (collision) Finds two inputs with the same hash to substitute a message under a valid signature
Replay Captures and resends a valid message; defeated by timestamps, nonces, challenge-response and session keys

Don’t forget the human route: social engineering a key out of someone is often easier than any cryptanalysis.

Exam tips

  • Practise the key-usage table until it’s automatic.
  • Hashing provides integrity, not confidentiality.
  • A birthday attack targets hash collisions; longer digests defend against it.
  • Revocation must be checked; an expired or revoked certificate shouldn’t be trusted.
  • Hybrid cryptography: asymmetric for key establishment, symmetric for bulk data.
  • HMAC gives integrity and authentication but not nonrepudiation; only digital signatures do.
  • IPsec tunnel mode for gateway-to-gateway VPNs; transport mode for host-to-host.

Common traps

  • Meet-in-the-middle vs man-in-the-middle: the first attacks double encryption; the second intercepts communications.
  • Signing vs encrypting: you sign with your own private key but encrypt with the recipient’s public key.
  • Diffie–Hellman agrees keys; it doesn’t encrypt messages or authenticate anyone by itself.
  • Digital signature confidentiality: none, unless you also encrypt.
  • CRL vs OCSP: CRLs are periodic lists with a delay; OCSP gives a live answer; stapling moves the OCSP query to the server.
  • RIPEMD-256 isn’t stronger than RIPEMD-160.
  • Link vs end-to-end encryption: link encryption hides headers but decrypts at every hop.
  • SSL is obsolete even though people still use the name.

Quick revision

  • Encrypt with recipient’s public key; sign with your private key.
  • RSA (factoring), DH (key agreement), ElGamal (DH-based encryption, doubles size), ECC (short keys).
  • 128-bit symmetric ≈ 3,072-bit RSA ≈ 256-bit ECC.
  • Hashes: MD5 128, SHA-1 160, SHA-2/SHA-3 224–512; salt and stretch passwords.
  • Signature = hash encrypted with private key → integrity, authentication, nonrepudiation.
  • PKI: CA, RA, offline root, intermediates, CSR, CRL, OCSP, stapling, X.509.
  • Keys: random, long enough, private, rotated, backed up, ideally in an HSM.
  • TLS 1.3 with ephemeral (EC)DH; S/MIME and PGP for email; IPsec AH/ESP, transport/tunnel.
  • Attacks: brute force, ciphertext-only, known/chosen plaintext, chosen ciphertext, side-channel, timing, fault injection, implementation, birthday, replay, MITM, meet-in-the-middle.

Key terms

Term Meaning
Certificate authority (CA) A trusted entity that signs certificates binding identities to public keys
Certificate signing request (CSR) The request, containing a public key, sent to a CA for signing
Digital signature A hash encrypted with the signer’s private key, proving origin and integrity
HMAC A keyed hash giving integrity and authentication without nonrepudiation
OCSP stapling A server attaching a fresh, CA-signed status response to its certificate
Perfect forward secrecy Session keys stay safe even if long-term keys are later compromised
Post-quantum cryptography Classical algorithms designed to resist attack by quantum computers
Quantum key distribution Using quantum physics to share keys so eavesdropping is detectable
Rainbow table A precomputed table used to reverse unsalted password hashes
Salt A random value added to each password before hashing
Security association A one-way IPsec relationship defining the protection applied to traffic
Side-channel attack Extracting secrets from physical effects such as power use or timing
Steganography Hiding the existence of data inside other content
Trusted Platform Module A motherboard chip that protects keys and attests to system integrity
X.509 The standard format for public key certificates

Sources