S+

CompTIA Security+ SY0-701

Lesson 2 of 12 — Cryptography & PKI

Day 2 ← Course Home ← Lesson 1
Lesson 2 — General Security Concepts (12% of exam)

Cryptography & PKI

Symmetric and asymmetric encryption, hashing algorithms, digital signatures, certificate authorities, the PKI lifecycle, and real-world TLS certificate analysis โ€” the mathematical backbone of modern security.

๐Ÿ“– 3 Topics ๐ŸŽฏ 2 Activities ๐Ÿ“ 5-Question Quiz โฑ ~60 min Domain: General Security Concepts

By the end of this lesson, you will be able to:

  • Compare and contrast symmetric and asymmetric encryption, identifying the correct algorithm for a given security scenario.
  • Explain how cryptographic hashing ensures data integrity and describe the properties of a secure hash function.
  • Describe how digital signatures provide authentication, integrity, and non-repudiation using asymmetric cryptography.
  • Define the role of a Certificate Authority (CA) and explain the purpose of X.509 digital certificates in a PKI environment.
  • Outline the PKI certificate lifecycle โ€” from generation and distribution to renewal and revocation.
  • Interpret the fields of a real TLS certificate and identify which field addresses which security concern.
  • Distinguish obfuscation from encryption and explain why obfuscation alone does not constitute a security control.
Encryption
The process of encoding plaintext into ciphertext using a cryptographic algorithm and key, making it unreadable to unauthorized parties.
Hashing
A one-way cryptographic function that converts data of any size into a fixed-length digest. The same input always produces the same output; any change to input produces a completely different digest.
PKI (Public Key Infrastructure)
The complete framework of hardware, software, policies, and procedures used to create, manage, distribute, use, store, and revoke digital certificates and public-key encryption.
Digital Signature
A cryptographic mechanism that uses the sender's private key to sign a message hash, allowing any recipient to verify the sender's identity and confirm the message was not altered.
CA (Certificate Authority)
A trusted third-party entity that issues, signs, and revokes digital certificates. The CA's own certificate must be trusted by relying parties for the chain of trust to function.
Obfuscation
The practice of making data or code difficult to understand without actually encrypting it. Obfuscation does NOT provide true confidentiality because it can be reversed without a cryptographic key.
Certificate Revocation List (CRL)
A published list maintained by a CA containing the serial numbers of certificates that have been revoked before their expiration date.
Blockchain
A distributed, append-only ledger that uses cryptographic hashing to link blocks of records, providing tamper-evident integrity for transactional data without a central authority.

Every time you visit an HTTPS website, send a digitally signed email, or log into a corporate VPN, cryptography is working silently in the background. It is the mathematical engine that makes trustworthy digital communication possible โ€” and it accounts for significant question coverage across every Security+ domain, not just General Concepts. Understanding cryptography is not optional for a security professional; it is a prerequisite.

This lesson demystifies the core cryptographic building blocks: how symmetric encryption provides fast, bulk data protection; how asymmetric encryption solves the key distribution problem; how hashing proves data integrity without revealing the data; and how all three come together in the PKI ecosystem to create the digital certificates that power secure web browsing, code signing, and email encryption. By the end of today, you will be able to read an actual TLS certificate and understand exactly what every field is telling you โ€” and why an attacker cares about it.

01

Encryption & Hashing

Symmetric vs. asymmetric encryption algorithms, key types, use cases, and one-way hash functions that prove integrity.

๐Ÿ”„ Click to flip

Encryption & Hashing

Symmetric (AES, 3DES) uses one shared key โ€” fast but requires secure key exchange. Asymmetric (RSA, ECC) uses a public/private key pair โ€” solves distribution but is computationally slow. Hashing (SHA-256, MD5) is a one-way function for integrity verification.

Deep Dive โ†’
02

Digital Signatures & Certificates

How private keys produce signatures that prove identity and integrity โ€” and what an X.509 certificate actually contains.

๐Ÿ”„ Click to flip

Digital Signatures & Certificates

A digital signature is a hash of a message, encrypted with the sender's private key. X.509 certificates bind a public key to an identity, signed by a trusted CA. Certificates enable TLS, code signing, email encryption (S/MIME), and client authentication.

Deep Dive โ†’
03

PKI Lifecycle & TLS Analysis

The end-to-end certificate lifecycle โ€” from key generation and CA signing to renewal and revocation โ€” plus live TLS certificate analysis.

๐Ÿ”„ Click to flip

PKI Lifecycle & TLS Analysis

The PKI lifecycle: generate key pair โ†’ create CSR โ†’ CA validates โ†’ CA issues signed certificate โ†’ deploy โ†’ monitor expiry โ†’ renew or revoke via CRL / OCSP. Real TLS certificates expose the Subject, Issuer, SAN, validity window, algorithm, and public key details.

Deep Dive โ†’
01
๐Ÿ”
Symmetrical vs. Asymmetrical Encryption
Explore the differences between symmetrical and asymmetrical encryption โ€” key structures, performance tradeoffs, and when to use each.
02
๐Ÿ”ข
Cryptographic Hashing: Ensuring Data Integrity
Learn about the four essential properties of cryptographic hashing and how hash functions protect data integrity without revealing the data itself.
03
โœ๏ธ
Digital Signatures
Learn how asymmetrical cryptography provides authentication, integrity, and non-repudiation through the digital signature process.
04
๐Ÿ›
PKI Life-Cycle
Learn about the PKI ecosystem of digital trust โ€” from key generation and CA issuance through renewal and revocation.
05
๐Ÿท
Understanding X.509 Digital Certificates
Authentication, Integrity, and Non-Repudiation in Public Key Infrastructure (PKI) โ€” how X.509 certificates bind identity to cryptographic keys.
๐Ÿ”“
Understanding Cryptography
Interactive Lab
Learn the basics about cryptography โ€” core concepts, vocabulary, and the foundational principles that underpin all secure communications.
โ†— Open Lab
๐Ÿ”
Encryption
Interactive Lab
Learn how the encryption process works โ€” step through the transformation of plaintext into ciphertext and back again.
โ†— Open Lab
๐Ÿ”ข
Understanding Hashing
Interactive Lab
Learn what cryptographic hashing is used for and how it works โ€” one-way functions, digest properties, and real-world integrity use cases.
โ†— Open Lab
๐Ÿ”
Symmetrical Encryption
Interactive Lab
Learn about data encoding and encryption โ€” explore how a shared secret key encrypts and decrypts data in symmetrical cryptographic systems.
โ†— Open Lab
๐Ÿ”‘
Asymmetrical Encryption and RSA
Interactive Lab
Learn how asymmetrical encryption works and how it is used โ€” explore public/private key pairs and the RSA algorithm in action.
โ†— Open Lab
๐Ÿงฎ
RSA Encryption
Interactive Lab
See how RSA works โ€” walk through key generation, encryption, and decryption with an interactive RSA demonstration tool.
โ†— Open Lab
โœ๏ธ
Digital Signature
Interactive Lab
Learn how digital signatures work and how they are used โ€” explore the signing and verification process step by step.
โ†— Open Lab
๐Ÿ›
PKI and Digital Certificates
Interactive Lab
Learn about PKI and how it works โ€” explore certificate authorities, trust chains, and the lifecycle of a digital certificate.
โ†— Open Lab
๐ŸŽซ
Kerberos
Interactive Lab
Learn about Kerberos and how it works โ€” explore ticket-based authentication and the roles of the KDC, TGT, and service tickets.
โ†— Open Lab
๐Ÿ”„
Diffie-Hellman
Interactive Lab
Learn about the Diffie-Hellman key exchange process โ€” see how two parties establish a shared secret over an insecure channel without ever transmitting the key itself.
โ†— Open Lab
1

Encryption & Hashing Fundamentals

Symmetric algorithms, asymmetric key pairs, hash functions, and obfuscation

Cryptography rests on two primary operations: encryption (a reversible transformation requiring a key) and hashing (a one-way transformation producing a fixed-length digest). Security+ tests both the theoretical properties of these operations and your ability to select the right tool for a given scenario.

Property Symmetric Encryption Asymmetric Encryption
Keys UsedSingle shared secret key for encrypt & decryptPublic key encrypts; private key decrypts (or vice versa for signatures)
SpeedVery fast โ€” suited for bulk data encryptionComputationally slow โ€” not used for large data volumes
Key ProblemSecure key distribution is the fundamental challengeSolves key distribution โ€” public key can be shared freely
Key AlgorithmsAES (128/256-bit), 3DES, ChaCha20RSA (2048/4096-bit), ECC (P-256, P-384), Diffie-Hellman
Key Length128โ€“256 bits is standard; shorter keys are weaker2048-bit RSA โ‰ˆ 112-bit symmetric security level
Use CasesEncrypting files, database fields, full-disk encryption, VPN tunnel dataTLS key exchange, digital signatures, certificate issuance, SSH keys
Common Hybrid UseTLS uses asymmetric to exchange a symmetric session key โ€” combining security of asymmetric with speed of symmetric

๐Ÿ” AES โ€” Advanced Encryption Standard

The gold standard for symmetric encryption, adopted by NIST in 2001. AES operates on 128-bit blocks and supports 128-, 192-, or 256-bit key lengths. AES-256 is considered computationally unbreakable with current technology and is used by U.S. government agencies to protect classified information.

  • Modes: CBC (Cipher Block Chaining), GCM (Galois/Counter Mode โ€” adds authentication), CTR
  • GCM preference: AES-GCM is authenticated encryption โ€” provides both confidentiality AND integrity in one operation
  • Exam tip: If a question asks for the strongest symmetric algorithm, AES-256 is the correct answer

๐Ÿ”‘ RSA & ECC โ€” Asymmetric Algorithms

RSA (Rivestโ€“Shamirโ€“Adleman) is the most widely deployed asymmetric algorithm, used in TLS certificates, SSH, and PGP. Its security depends on the computational difficulty of factoring large prime numbers. ECC (Elliptic Curve Cryptography) achieves equivalent security at much shorter key lengths.

  • RSA 2048-bit โ‰ˆ ECC 224-bit in security strength
  • ECC is preferred for mobile/IoT devices due to lower computational overhead
  • Exam tip: ECC provides equivalent security to RSA with shorter keys โ€” better performance on constrained devices

๐Ÿ”ข Cryptographic Hashing

A hash function takes any input and produces a fixed-length output (digest) that uniquely represents the input. Hash functions are one-way โ€” you cannot reverse a hash to get the original data. They are deterministic โ€” the same input always produces the same digest.

  • SHA-256: 256-bit digest; NIST-recommended; used in TLS, code signing, Bitcoin
  • SHA-3: Alternative to SHA-2; different internal design, useful for defense-in-depth
  • MD5 & SHA-1: Both are cryptographically broken โ€” collision attacks demonstrated; do NOT use for security
  • HMAC: Hash-based Message Authentication Code โ€” adds a secret key to a hash for integrity + authentication

๐ŸŽญ Obfuscation โ€” What It Is NOT

Obfuscation makes data or code harder to understand without actually encrypting it. Common examples include Base64 encoding, ROT13, and code minification. These are not encryption because they do not require a key and can be reversed without one.

  • Base64 is encoding, not encryption โ€” any tool can decode it instantly
  • Malware authors use obfuscation to evade signature-based detection
  • Steganography (hiding data inside images or audio) is a form of obfuscation
  • Exam trap: Obfuscation does NOT provide Confidentiality โ€” it is NOT a substitute for encryption
Hybrid Encryption in Practice (TLS 1.3): TLS 1.3 uses the Diffie-Hellman Ephemeral (DHE) or Elliptic Curve DHE (ECDHE) key exchange โ€” an asymmetric operation โ€” to negotiate a unique symmetric session key for each connection. The actual data transfer is then encrypted with AES-GCM (symmetric), combining the key-distribution security of asymmetric cryptography with the bulk-data speed of symmetric encryption. This is the pattern behind every HTTPS connection you make.
2

Digital Signatures & X.509 Certificates

How asymmetric cryptography enables authentication, integrity, and non-repudiation

A digital signature is not a scanned image of a handwritten signature โ€” it is a cryptographic proof of identity and message integrity. Digital certificates are the mechanism by which public keys are bound to real-world identities and made trustworthy.

โœ๏ธ How Digital Signatures Work

Signing (sender side):

  1. Hash the message using SHA-256 (produces a fixed-length digest)
  2. Encrypt that hash with the sender's private key โ†’ this is the digital signature
  3. Send the message + signature together

Verification (recipient side):

  1. Decrypt the signature using the sender's public key โ†’ recovers the original hash
  2. Hash the received message independently
  3. Compare the two hashes โ€” if they match, the message is authentic and unaltered

๐Ÿ† What Digital Signatures Provide

  • Authentication: Only the holder of the private key could have created the signature โ€” proves sender identity
  • Integrity: Any modification to the message after signing invalidates the signature (hash mismatch)
  • Non-Repudiation: The sender cannot deny having signed the message โ€” only their private key could have produced it
Exam Distinction: Encryption provides Confidentiality. Signing provides Authentication + Integrity + Non-Repudiation. In practice, a message can be both encrypted AND signed simultaneously.

X.509 Certificate Structure โ€” What Every Field Means

๐Ÿท Subject & Subject Alternative Name

The Subject field identifies the entity the certificate was issued to (e.g., Common Name = www.example.com, Organization = Example Corp). The SAN (Subject Alternative Name) lists all additional domain names and IP addresses the certificate is valid for โ€” modern browsers only trust the SAN, not the CN.

๐Ÿ› Issuer & Signature

The Issuer field identifies the CA that signed the certificate (e.g., DigiCert Global Root G2). The CA's digital signature over the certificate contents is what makes the certificate trustworthy โ€” any tampering invalidates the signature.

๐Ÿ“… Validity Period

The Not Before / Not After fields define the certificate's active window. Expired certificates trigger browser warnings. Since September 2020, publicly trusted TLS certificates are capped at 398-day validity to reduce long-term exposure from compromised keys.

๐Ÿ”‘ Public Key & Algorithm

The certificate embeds the subject's public key and specifies the key algorithm (RSA 2048, ECDSA P-256, etc.). Browsers use this public key to establish the TLS session. The signature algorithm field specifies how the CA signed the certificate (e.g., sha256WithRSAEncryption).

๐Ÿ†” Serial Number

A unique identifier assigned by the CA to each certificate it issues. The serial number is used in Certificate Revocation Lists (CRLs) and OCSP (Online Certificate Status Protocol) responses to identify revoked certificates.

๐ŸŽฏ Certificate Extensions

Extensions encode additional policy information: Key Usage restricts what the key may be used for (e.g., digital signature, key encipherment). Extended Key Usage specifies application purposes (TLS server authentication, code signing, email protection). Basic Constraints indicates whether the certificate is a CA certificate.

Certificate Trust Chains: No browser trusts a website's certificate directly. Instead, it follows a chain of trust: the website certificate was signed by an Intermediate CA, which was signed by a Root CA. Root CA certificates are pre-installed in operating systems and browsers. If any link in the chain is broken (revoked, expired, or untrusted), the entire chain fails. This is why proper certificate chain configuration on servers is a critical operational security task.
3

PKI Lifecycle & TLS Certificate Analysis

From key generation to revocation โ€” and how to read a real certificate

PKI is not a single product โ€” it is an ecosystem of roles, processes, and policies that govern the complete lifecycle of digital certificates. Understanding this lifecycle is essential for Security+ because both mismanagement (expired certs, weak keys, improper revocation) and deliberate attacks target every phase.

1

Key Pair Generation

The entity (server, user, or device) generates an asymmetric key pair. The private key is created and stored securely โ€” ideally in a Hardware Security Module (HSM) or a TPM (Trusted Platform Module) to prevent extraction. The private key must never leave the HSM in plaintext. Key length matters: RSA 2048-bit minimum; RSA 4096 or ECDSA P-256 preferred for new deployments.

2

Certificate Signing Request (CSR)

The entity creates a CSR โ€” a structured message containing the public key and identity information (subject, organization, domain). The CSR is signed with the entity's private key to prove possession of it. The CSR is submitted to the CA; it contains no secrets and can be transmitted over insecure channels.

3

CA Validation & Issuance

The CA performs identity validation โ€” the rigor depends on the certificate type. Domain Validation (DV) only confirms domain control (automated, minutes). Organization Validation (OV) verifies organizational identity (hours to days). Extended Validation (EV) performs thorough legal entity verification (days to weeks). The CA then signs the certificate with its private key and returns it to the requester.

4

Deployment & Distribution

The signed certificate is installed on the server (or device). For web servers, the full certificate chain (leaf + intermediate(s)) must be configured โ€” a missing intermediate is one of the most common TLS configuration errors. Certificates can also be published to LDAP directories for S/MIME email encryption lookup.

5

Monitoring & Renewal

Certificate expiry monitoring is a critical operational task โ€” expired certificates cause outages (systems refuse connections) and security alerts. Certificates should be renewed 30โ€“60 days before expiration. Let's Encrypt's ACME protocol automates this process for public websites. Enterprises use certificate lifecycle management (CLM) tools to track their entire certificate inventory.

6

Revocation โ€” CRL & OCSP

When a certificate is compromised, mis-issued, or the entity's status changes, it must be revoked before expiration. CRL (Certificate Revocation List): A periodically published list of revoked serial numbers โ€” can be large and stale. OCSP (Online Certificate Status Protocol): Real-time single-certificate status check โ€” more efficient but requires server availability. OCSP Stapling: The server pre-fetches its own OCSP response and staples it to the TLS handshake, improving privacy and performance.

Sample TLS Certificate โ€” Annotated

Certificate: Version: 3 (0x2) Serial Number: 03:e4:2a:7c:91:b8:4f:0a:12:cd:78:55:aa:22:01:bc:9f โ†‘ Unique identifier; used in CRL/OCSP to revoke this certificate Signature Algorithm: sha256WithRSAEncryption โ†‘ SHA-256 hash + RSA signature โ€” how the CA digitally signed this cert Issuer: O=DigiCert Inc, CN=DigiCert TLS RSA SHA256 2020 CA1 โ†‘ Intermediate CA that signed this cert โ€” the CA's identity Validity: Not Before: Sep 15 00:00:00 2024 GMT Not After : Oct 14 23:59:59 2025 GMT โ†‘ 398-day validity window โ€” expired certs = outages + browser warnings Subject: CN=www.example-corp.com O=Example Corporation, Inc., C=US Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public-Key: (2048 bit) โ†‘ The public key browsers use to establish the encrypted session X509v3 Extensions: Subject Alternative Name (SAN): DNS:www.example-corp.com DNS:example-corp.com DNS:api.example-corp.com โ†‘ All valid hostnames โ€” modern browsers REQUIRE the SAN field Key Usage: Digital Signature, Key Encipherment Extended Key Usage: TLS Web Server Authentication โ†‘ Restricts use: this cert is only valid for TLS server auth CRL Distribution Points: http://crl3.digicert.com/DigiCertTLSRSASHA2562020CA1-4.crl OCSP URL: http://ocsp.digicert.com โ†‘ Where to check if this certificate has been revoked
Security+ Exam Insight โ€” Certificate Types: Know the difference between DV, OV, and EV certificates. DV certificates are quick to obtain and provide encryption but no organizational verification โ€” they are widely abused by phishing sites. OV and EV certificates verify organizational identity, making them more trustworthy for e-commerce and financial services. Since browsers removed the EV green bar indicator, the practical distinction for end-users has diminished, but the exam still tests it.
Activity 1

Cryptography Concept Sort โ€” Drag & Drop

Sort each algorithm or technique into the correct cryptographic category

Instructions: Drag each chip from the pool below into its correct cryptographic category. Some may seem tricky โ€” think carefully about the key structure. Submit to receive instant feedback. Click ร— on a placed chip to return it.
AES-256
RSA-2048
SHA-256
3DES
ECC (P-256)
MD5
ChaCha20
HMAC-SHA256
Diffie-Hellman
Symmetric Encryption
Asymmetric Encryption
Hashing / One-Way
Activity 2

TLS Certificate Field Analyzer

Read the sample certificate data, then answer questions about what each field reveals

Instructions: Examine the certificate fields from the annotated certificate in Topic 3. Answer each question below by selecting the best option. Submit each question individually to get immediate feedback.
Subject CN
www.example-corp.com
Issuer
DigiCert TLS RSA SHA256 2020 CA1
Valid Until
Oct 14 23:59:59 2025 GMT
Public Key
RSA 2048-bit
Signature Algorithm
sha256WithRSAEncryption
SAN Entries
www.example-corp.com, example-corp.com, api.example-corp.com
Q1: A browser connects to api.example-corp.com. Based on the certificate, will the TLS connection succeed without a certificate warning?
Q2: What entity vouches for the authenticity of this certificate and ensures it is trustworthy?
Q3: It is November 1, 2025. A user visits www.example-corp.com and their browser displays a security warning. Based solely on the certificate data provided, what is the most likely cause?
Q4: The security team discovers that the private key associated with this certificate has been compromised. Which PKI mechanism should they use to immediately invalidate the certificate before it expires?
Assessment

Knowledge Check: Cryptography & PKI

Select the best answer for each question, then submit for graded feedback

Question 1 of 5
An organization needs to encrypt large volumes of backup data stored on tape drives. The encryption must be fast and the keys will be managed internally. Which type of encryption is MOST appropriate?
Question 2 of 5
A developer digitally signs a software release package before publishing it to users. Which of the following security properties does the digital signature DIRECTLY provide? (Select the BEST answer.)
Question 3 of 5
A security analyst discovers that a critical system's TLS certificate is using SHA-1 as its signature algorithm. Why is this a security concern?
Question 4 of 5
An employee submits a Certificate Signing Request (CSR) to the internal CA to obtain a certificate for a new internal application server. Which component of the key pair is included in the CSR?
Question 5 of 5
A penetration tester reviews an application's source code and discovers that sensitive internal routing information is protected only by Base64 encoding. Which statement BEST characterizes this finding?