Cryptography and PKI
Week 2 · Module 2: Cryptography and PKI · Download .docx
Objectives
- Distinguish symmetric and asymmetric encryption by key structure, speed, and use case.
- Explain how AES, RSA, and ECC differ in algorithm type, key size, and application.
- Describe how hashing provides data integrity and explain the avalanche effect.
- Explain the role of a Certificate Authority (CA) and what a digital certificate binds together.
- Describe how TLS uses certificates to secure HTTPS and how CRL and OCSP handle revocation.
Key terms
- symmetric encryption
- Encryption that uses the same key for both encrypting and decrypting; fast and efficient but requires secure key sharing in advance.
- asymmetric encryption
- Encryption using a mathematically related key pair: a public key to encrypt and a private key to decrypt; solves key distribution but is computationally slower.
- AES
- Advanced Encryption Standard — the dominant symmetric block cipher; AES-256 uses a 256-bit key and is the current gold standard for data encryption at rest and in transit.
- RSA
- Asymmetric algorithm based on the difficulty of factoring large prime numbers; common key sizes are 2048 to 4096 bits for strong security.
- ECC
- Elliptic Curve Cryptography — asymmetric algorithm providing equivalent or stronger security than RSA with much smaller key sizes; efficient for mobile and constrained environments.
- hashing
- A one-way mathematical function that converts any input into a fixed-length digest; cannot be reversed and is used to verify data integrity.
- SHA-256
- Secure Hash Algorithm 256 — produces a 256-bit digest; part of the SHA-2 family and widely used in TLS certificates, code signing, and blockchains.
- avalanche effect
- The property of a cryptographic hash function in which a tiny change in the input produces a completely different output digest.
- digital certificate
- An X.509 document issued by a CA that cryptographically binds a public key to a verified identity such as a domain, person, or organization.
- CA
- Certificate Authority — a trusted third party that issues, signs, and revokes digital certificates, establishing the root of trust in a PKI.
- TLS
- Transport Layer Security — the cryptographic protocol that secures HTTPS; uses a certificate-based handshake to authenticate the server and establish an encrypted session.
- CRL
- Certificate Revocation List — published by a CA and containing the serial numbers of certificates revoked before their scheduled expiration date.
- OCSP
- Online Certificate Status Protocol — allows real-time querying of a CA to determine whether a specific certificate is still valid or has been revoked.
- digital signature
- Created by applying the sender's private key to a hash of the message; recipients verify the signature using the sender's public key to confirm authenticity and integrity.
The concept
Cryptography is the mathematical foundation of virtually every security control in use today. Security+ tests cryptography as both a concept and a practical skill: you must be able to choose the right algorithm for a given scenario and explain what each algorithm type provides.
## Symmetric vs. Asymmetric Encryption
Symmetric encryption uses one shared key. The same key that encrypts the data decrypts it. This makes symmetric encryption very fast — modern hardware can encrypt gigabytes per second with AES. The problem is key distribution: how do two parties securely agree on that shared key if they have never met? Symmetric encryption alone cannot solve this. AES is the dominant symmetric algorithm. 3DES is its predecessor and is being phased out. Asymmetric encryption uses a mathematically linked key pair. Data encrypted with the public key can only be decrypted by the matching private key. The public key is freely shared; the private key is kept secret. This solves key distribution but is computationally slow — about 1,000 times slower than AES for bulk data. RSA (based on prime factorization) and ECC (based on elliptic curve math) are the two primary asymmetric algorithms. ECC achieves equivalent security to RSA with much smaller keys, making it preferred for mobile devices and certificates.
## Hashing and Data Integrity
Hashing is not encryption — it is a one-way transformation. A hash function takes any input and produces a fixed-length digest. SHA-256 always outputs 256 bits regardless of whether the input is a single character or a 10-gigabyte file. Hash functions have two critical properties: pre-image resistance (you cannot reverse a hash to find the original input) and the avalanche effect (changing even one bit in the input produces a completely different output). These properties make hashing ideal for verifying data integrity — if a file's hash before and after transmission matches, the file was not altered. MD5 and SHA-1 are broken for security purposes; SHA-256 and SHA-3 are current standards.
## PKI, Certificates, and TLS
Public Key Infrastructure (PKI) is the system of trust that allows two parties who have never met to communicate securely. A Certificate Authority (CA) — a trusted third party — issues X.509 digital certificates that bind a public key to a verified identity. When your browser connects to a bank, it receives the bank's TLS certificate, verifies that it was signed by a trusted CA, and uses the bank's public key to complete the TLS handshake. The TLS handshake negotiates a symmetric session key (using ECDHE for forward secrecy) that encrypts all subsequent traffic. If a certificate is compromised, the CA revokes it; the CRL lists revoked certificate serial numbers, while OCSP provides real-time revocation status. Digital signatures use the private key to sign — the recipient uses the sender's public key to verify the signature confirms both identity and integrity.
Worked examples
Common mistakes
- Thinking encryption and hashing are interchangeable. Encryption is reversible with the correct key — that is its purpose. Hashing is irreversible by design. When a question asks about verifying that a file was not modified, the answer involves hashing, not encryption.
- Confusing which key encrypts and which signs. To send a confidential message, encrypt with the recipient's public key. To prove you sent a message, sign with your own private key. The two operations use different keys for different security goals: public key for confidentiality to a recipient; private key for authenticity from a sender.
- Assuming SSL and TLS are the same. SSL was deprecated in 2015 due to POODLE and BEAST attacks. Modern HTTPS uses TLS 1.2 or TLS 1.3. On Security+ exams, if a question asks what secures HTTPS today, the answer is TLS — never SSL.
- Confusing CRL and OCSP. Both handle certificate revocation, but CRL is a downloaded list checked periodically, while OCSP is a real-time protocol that queries the CA per certificate check. OCSP Stapling further improves performance by having the server cache and provide the OCSP response directly in the TLS handshake.
- Believing MD5 is still acceptable for security use. MD5 produces a 128-bit digest and is completely broken for cryptographic security — collision attacks can generate two inputs with the same MD5 hash in seconds. MD5 is sometimes still used for non-security checksums, but never for integrity verification in security contexts. SHA-256 is the minimum for security use.
Self-check
Try each one before you look. A miss here costs nothing and tells you exactly what to reread.
Canvas is the official record. This companion enhances the PGCC curriculum; it does not replace it. Last name and class year only. Students with a 504 plan or IEP: your accommodations apply.