Cryptography and PKI for Security+: What You Must Actually Reason About
Symmetric vs asymmetric crypto, hashing vs encryption, certificates, TPM/HSM, and the PKI lifecycle topics that SY0-701 loves to test.
During a tabletop exercise, legal asks whether emailed contract PDFs were tampered with. Engineering says "they were TLS-downloaded, so we're fine." You pause: TLS protects in transit, not after save. Legal needs integrity at rest and non-repudiation on signatures—not "HTTPS was green." SY0-701 cryptography questions feel like trivia until you frame them as property + lifecycle + key custody decisions. This post covers what to reason about: encryption vs hashing, symmetric vs asymmetric, key storage, PKI lifecycle, and exam traps—without turning into a math textbook.
Goals first: pick the tool by security property
| Goal | Right tool family | Wrong common pick | Why the wrong pick fails |
|---|---|---|---|
| Keep content secret | Encryption (symmetric or asymmetric) | Hashing alone | Hashes are one-way; you cannot recover plaintext |
| Detect tampering | Hashing, digital signatures | Reversible encryption | Encryption hides content but comparison is keyed differently |
| Verify password without storing it | Salted slow hash | Plain MD5/SHA without salt | Rainbow tables and speed crack weak stores |
| Prove sender + integrity | Digital signature | Symmetric MAC only | Key distribution differs; signatures use asymmetric pairs |
| Hide existence of data | Steganography | Compression | Compression is not secrecy |
Tokenization replaces sensitive data with a surrogate token mapped in a secure vault—useful in PCI-style designs. Data masking shows redacted or fictional values in lower environments. Neither is interchangeable with "encrypt everything the same way."
Worked example: password database leak
A breach exposes user_table with columns username, password_hash. Hashes are unsalted SHA-256.
- Property lost: confidentiality of credentials (offline cracking).
- Fix direction: unique salt per password + slow KDF (bcrypt, scrypt, Argon2 class)—not "encrypt the hash column with AES" (key management becomes the new single point of failure).
- Exam angle: "Encrypt passwords" is almost always wrong wording; hash with salt is the pattern.
Symmetric vs asymmetric encryption
Symmetric algorithms (AES is the common exam reference) use one shared secret key for encrypt and decrypt. Fast for bulk data. Hard part: how do two parties share the key without an attacker copying it?
Asymmetric algorithms (RSA, ECC families) use key pairs: public key encrypts or verifies; private key decrypts or signs. Solves distribution for key exchange and identity. Slower—so real protocols hybridize.
Typical TLS handshake pattern (conceptual):
- Asymmetric step establishes identity and agrees session material.
- Symmetric session keys encrypt bulk traffic for performance.
| Aspect | Symmetric | Asymmetric |
|---|---|---|
| Keys | Shared secret | Public + private pair |
| Speed | Fast | Slower |
| Primary exam uses | Bulk encryption | Key exchange, digital signatures |
| Key compromise impact | Shared secret exposure | Private key exposure |
Key exchange protocols (Diffie–Hellman, ECDHE in modern TLS) let parties derive shared secrets over an untrusted channel without transmitting the secret itself—forward secrecy enters advanced stems when ephemeral keys limit past session decryption if long-term keys leak.
Exam trap: "Which encrypts faster for a 10 GB backup stream?" → symmetric. "Which proves server identity in HTTPS?" → certificate-backed asymmetric trust, then symmetric bulk.
Hashing, salting, and stretching
Hashing maps input to fixed-length digest; one-way under exam assumptions. Used for integrity checks and password verifiers.
Salting adds unique random data per record before hash—defeats rainbow tables because crackers must attack each salt separately.
Key stretching / KDF repeats hash or memory-hard work—slows offline guessing.
Digital signatures combine asymmetric keys with hash of document: private key signs hash; anyone with public key verifies integrity and signer binding—supports non-repudiation when keys are well governed.
Obfuscation vs encryption
Obfuscation hides meaning without strong cryptographic guarantees (encoding, simple XOR toys). Encryption assumes rigorous key control. Exams may mention steganography hiding data inside images/audio—secrecy of existence, not just content.
Do not pick obfuscation when the stem demands regulatory-grade confidentiality.
Where keys live: TPM, HSM, KMS, secure enclave
Key custody questions dominate SY0-701 crypto scenarios.
| Technology | What it protects | Typical exam scenario |
|---|---|---|
| TPM | Platform-rooted keys, measurements, sealed storage | Laptop full-disk encryption key sealed to boot state |
| HSM | Hardware module for high-assurance key ops, often non-exportable keys | CA signing, payment HSM, code-signing |
| KMS | Central key lifecycle—create, rotate, revoke, audit | Cloud envelope encryption with DEK/KEK hierarchy |
| Secure enclave | Isolated execution for crypto on CPU (SGX-style concepts) | Protect keys in use from OS compromise |
Why it matters: "Private key must never leave hardware" → HSM or TPM-backed workflow, not a .pem on a share. "Cloud service encrypts S3 objects with customer-managed keys" → KMS vocabulary.
Exam trap: TPM ≠ HSM. TPM is platform-attached trust anchor; HSM is often appliance/module for enterprise signing with stricter ops controls.
PKI building blocks
Public Key Infrastructure binds identities to public keys via certificates signed by Certificate Authorities (CAs).
Core objects:
- Public key — distributed freely
- Private key — strictly protected; loss = impersonation
- Certificate — CA statement: "this public key belongs to this subject"
- CSR (Certificate Signing Request) — entity requests certification of its public key
- Root of trust — anchor CA your system trusts
Chain validation (simplified):
Root CA (self-signed trust anchor)
→ Intermediate CA
→ Leaf certificate (server or user)Failure at any link → browser/app warnings or silent trust breaks in APIs.
Revocation: CRL vs OCSP
| Mechanism | How it works | Tradeoff |
|---|---|---|
| CRL | Downloadable list of revoked serial numbers | Can be stale; client must fetch full list |
| OCSP | Online query: is this cert still good? | Real-time; privacy/availability dependencies |
| OCSP stapling | Server presents recent OCSP proof with handshake | Reduces client lookup delays |
Exam trap: expired certificate vs revoked certificate—both fail validation, but fix differs (renew vs reissue + remove trust). Wrong hostname in cert (CN/SAN mismatch) fails identity check even if chain is valid.
Wildcard and SAN certificates
Wildcard (*.example.com) simplifies admin for subdomains but increases blast radius if private key leaks—any matching host impersonation. Subject Alternative Name (SAN) lists explicit names; modern practice favors SAN-heavy certs over legacy CN-only thinking.
Self-signed vs public CA
Self-signed certs require explicit trust store installation—fine for labs/internal PKI, risky if users are trained to click through warnings. Public CAs anchor trust for the open internet.
Key escrow
Key escrow stores keys with a third party for recovery (legal/compliance/business continuity). Tension: aids decryption after employee loss; increases insider/government access risk. Exams present as tradeoff, not "always good."
Encryption scope: at rest, in transit, in use
| Scope | Protects against | Does not magically fix |
|---|---|---|
| In transit (TLS, IPsec) | Network eavesdrop, many MITM if trust validated | Compromised endpoint after decrypt |
| At rest (FDE, database TDE) | Stolen disk/media | Live system access while OS unlocked |
| In use (confidential computing, enclaves—conceptual) | Memory scraping on hostile OS | Poor app logic exfil |
Full-disk encryption (FDE) vs file/volume vs record-level field encryption—stem chooses based on granularity and key management appetite. Database TDE protects storage media; app-layer field encryption adds finer control with more dev cost.
Worked example: stolen laptop
Controls:
- FDE with TPM + PIN → protects at rest if powered off
- Screen lock + idle timeout → reduces in use exposure
- Remote wipe → corrective containment
TLS to cloud apps does not help offline disk forensics if FDE absent or weak password.
Blockchain / distributed ledger (exam depth)
SY0-701 expects concept-level knowledge: chained blocks, hashes linking integrity, distributed copies reducing single-point tamper—not deploying production smart contracts. Exam angles tie to integrity and audit trails where many parties must agree on history without a single editor.
Common cryptography exam traps
- "Encrypt password database" → should be salted hash.
- Hash for confidentiality → hashes do not hide data from anyone who can guess inputs.
- Symmetric for web server identity → need certificates (asymmetric trust).
- Revocation ignored → client must check CRL/OCSP; misconfig trusts revoked certs.
- Downgrade attacks → outdated protocols (SSLv3, weak ciphers) enabled "for compatibility."
- Same key encrypt and sign (bad practice) → key reuse across contexts breaks isolation—exams hint at separation of duties for keys.
Comparison: when auditors ask different questions
| Auditor question | Crypto answer |
|---|---|
| "Can we prove the file wasn't altered?" | Digital signature or trusted hash compare |
| "Can we read data if disk stolen?" | FDE + strong auth |
| "Can user deny sending email?" | Signed message or mail system non-repudiation controls |
| "Can we rotate keys quarterly?" | KMS lifecycle policy |
How to practice
- Property drill: for ten assets (email, VPN creds, contract PDF, API token), assign confidentiality/integrity/availability/non-repudiation needs and pick controls.
- TLS storyboard: draw client-server handshake; label asymmetric vs symmetric phases.
- Break-the-chain lab: import a cert with missing intermediate; observe failure; fix trust store.
- Revocation check: use
openssl ocspor browser dev tools to see OCSP status on a live site (read-only recon). - Flashcard ban: instead of algorithm acronyms alone, write scenario → choice → because.
Security+ crypto success is decision quality, not memorizing block sizes. When legal asks about tampered PDFs, you answer with signatures and hashes, clarify TLS scope, and point to HSM-backed signing if non-repudiation must survive dispute—exactly the reasoning SY0-701 rewards.