Practice Cryptography & PKI questions for the CompTIA Security+. Every question includes a full explanation of why the correct answer is right and why the tempting distractors are wrong.
24 questions available · hard difficulty · Security+ · Free, no registration required
10 example questions with full explanations. Use the interactive practice above to work through the complete set.
Question 1hard
An enterprise PKI administrator is auditing certificate lifecycle management practices after discovering certificates were being used beyond their validity period. Select all that apply — which actions represent correct PKI certificate lifecycle management procedures?
- A.A Certificate Signing Request (CSR) contains the applicant's private key so the CA can sign the certificate
- B.OCSP stapling allows a web server to cache and present a signed OCSP response, reducing client latency and CA load✓
- C.Revoking a certificate via CRL takes effect immediately for all clients regardless of their CRL caching interval
- D.When a certificate is revoked, the CA publishes the serial number of the revoked certificate on the CRL✓
- E.A CA can issue an OCSP response indicating a certificate's revocation status without requiring the client to download an entire CRL✓
Correct answer: B, D, E
OCSP stapling lets the server pre-fetch and cache a CA-signed OCSP response, reducing latency and CA infrastructure load (B). CRLs list revoked certificate serial numbers, not the certificates themselves, so D is correct. OCSP provides per-certificate status responses, allowing clients to check a single certificate's status without downloading the full CRL (E). Option A is definitively wrong — a CSR contains the applicant's public key, never the private key; the private key must remain secret. Option C is wrong because CRL revocation is not instantaneous for clients; clients cache CRLs until the nextUpdate time, meaning revocation may not be recognized until the cached CRL expires.
Question 2hard
A government agency is planning to upgrade its cryptographic infrastructure in anticipation of quantum computing threats. The Chief Security Officer asks which current algorithms are most at risk and what mitigations exist. Select all that apply — which statements are accurate regarding quantum computing threats to cryptography?
- A.Shor's algorithm poses a practical threat to RSA and ECC because it can efficiently solve the integer factorization and discrete logarithm problems that underpin these algorithms✓
- B.AES-256 is considered quantum-resistant without modification because Grover's algorithm only reduces its effective security to approximately 128 bits, which remains computationally infeasible to attack✓
- C.CRYSTALS-Kyber is a NIST-selected post-quantum algorithm designed to replace symmetric encryption algorithms like AES
- D.Doubling the key length of symmetric encryption algorithms is a practical short-term mitigation against Grover's algorithm on quantum computers✓
- E.SHA-256 hashing is completely broken by quantum algorithms, requiring immediate replacement with post-quantum hash functions
Correct answer: A, B, D
Shor's algorithm efficiently factors large integers and solves discrete logarithms on a quantum computer, directly breaking RSA and ECC (A). Grover's algorithm provides a quadratic speedup against symmetric ciphers, reducing AES-256's effective strength to ~128 bits — still secure against foreseeable quantum attacks (B). Doubling symmetric key lengths (e.g., moving from AES-128 to AES-256) compensates for Grover's quadratic speedup, making it a valid mitigation (D). Option C is wrong — CRYSTALS-Kyber is a post-quantum key encapsulation mechanism (KEM) designed to replace asymmetric algorithms like RSA for key exchange, not symmetric algorithms. Option E is wrong — Grover's algorithm reduces hash function security by a square root factor, meaning SHA-256 retains ~128-bit quantum security, which is not broken and does not require immediate replacement.
Question 3hard
During a forensic investigation, an analyst discovers that sensitive data was being covertly transmitted inside image files uploaded to a public file-sharing site. The analyst must explain to the incident response team how this technique works and how it differs from encryption. Select all that apply — which statements accurately describe steganography and how it compares to encryption in this scenario?
- A.Steganography conceals the existence of a message by embedding it within a carrier medium, whereas encryption transforms plaintext into unreadable ciphertext but does not hide the fact that a secret message exists✓
- B.Combining steganography with encryption provides stronger security than either technique alone, because the hidden message is both concealed and unintelligible if discovered✓
- C.Steganography modifies the carrier file in ways that are always detectable by standard antivirus software
- D.LSB (Least Significant Bit) steganography in images works by replacing the lowest-order bits of pixel color values with message bits, causing imperceptible visual changes✓
- E.Steganography provides non-repudiation for the sender because embedding data in a file proves authorship of the hidden message
Correct answer: A, B, D
Steganography hides the fact that communication is occurring at all, while encryption makes data unreadable but visible — these are complementary security properties (A). Using both techniques means an adversary must first detect hidden content exists and then decrypt it, providing layered security (B). LSB steganography replaces the least significant bits of pixel values with message data; the visual difference is imperceptible to the human eye (D). Option C is wrong — standard antivirus tools are generally not designed to detect steganography; specialized steganalysis tools are required, and detection is not guaranteed. Option E is wrong — steganography provides no authentication or non-repudiation; proving who embedded data requires additional mechanisms like digital signatures.
Question 4easy
A developer needs to store user passwords in a database so that even if the database is compromised, the passwords remain protected and are resistant to brute-force attacks. Which algorithm is best suited for this purpose?
- A.MD5
- B.SHA-256
- C.bcrypt✓
- D.AES-256
Correct answer: C
bcrypt is specifically designed for password hashing. It incorporates a salt to prevent rainbow table attacks and uses a configurable cost factor (iterations) that makes brute-force attacks computationally expensive. MD5 and SHA-256 are general-purpose hashing algorithms that are too fast for password storage, making them vulnerable to brute-force attacks. AES-256 is a symmetric encryption algorithm, not a hashing algorithm, and is not appropriate for one-way password storage.
Question 5easy
A company wants to encrypt large amounts of data quickly using a single shared secret key. Which type of encryption should they use?
- A.Asymmetric encryption using RSA
- B.Diffie-Hellman key exchange
- C.Elliptic Curve Cryptography (ECC)
- D.Symmetric encryption using AES-256✓
Correct answer: D
Symmetric encryption, such as AES-256, uses a single shared secret key for both encryption and decryption and is designed for fast bulk data encryption. Asymmetric encryption (RSA) uses a key pair and is significantly slower, making it unsuitable for encrypting large volumes of data directly. Diffie-Hellman is a key exchange protocol, not an encryption algorithm. ECC is an asymmetric algorithm used for key exchange and digital signatures, not bulk data encryption.
Question 6easy
An employee receives a digitally signed email. Which key does the recipient use to verify the digital signature?
- A.The sender's public key✓
- B.The recipient's private key
- C.The sender's private key
- D.A shared symmetric key
Correct answer: A
In a digital signature scheme, the sender signs the message using their own private key, and the recipient verifies the signature using the sender's public key. This process provides authentication (proof of sender identity), integrity (the message was not altered), and non-repudiation (the sender cannot deny sending it). The recipient's private key is used to decrypt messages encrypted for the recipient, not to verify signatures.Bshared symmetric key plays no role in asymmetric digital signature verification.
Question 7easy
An organization is building its internal Public Key Infrastructure. The root CA has signed a certificate for an intermediate CA, which in turn issues certificates to end users. What does this structure describe?
- A.A web of trust model
- B.A PKI hierarchy✓
- C.A self-signed certificate chain
- D.An OCSP responder configuration
Correct answer: B
A PKI hierarchy (also called a certificate hierarchy or chain of trust) consists of a root CA at the top, which signs certificates for one or more intermediate CAs, which in turn issue certificates to end entities such as users or servers. This structure isolates the root CA from direct certificate issuance, improving security. A web of trust is a decentralized model used in PGP where individuals vouch for each other. Self-signed certificates are not signed by a CA at all. OCSP is a certificate revocation protocol, not a structural model.
Question 8easy
Which of the following best describes how TLS achieves both performance and security by combining two types of encryption?
- A.TLS uses asymmetric encryption to encrypt all session data for maximum security
- B.TLS uses symmetric encryption to exchange the initial keys, then switches to asymmetric for data transfer
- C.TLS uses asymmetric encryption to securely exchange a symmetric session key, then uses that symmetric key to encrypt all session data✓
- D.TLS uses hashing algorithms to encrypt all data exchanged between client and server
Correct answer: C
TLS uses a hybrid encryption approach: during the handshake, asymmetric encryption (e.g., RSA or ECC) is used to securely exchange or negotiate a symmetric session key. Once established, the symmetric session key (e.g., AES) is used to encrypt all subsequent data, providing the speed needed for bulk data transfer. Using only asymmetric encryption for all data would be far too slow. Hashing algorithms provide integrity, not encryption. The order in option B is reversed from how hybrid encryption actually works.
Question 9easy
A developer needs to secure communication between two parties who have never met and must agree on a shared secret key over an untrusted network. Which algorithm is specifically designed for this purpose?
- A.AES-256
- B.SHA-256
- C.RSA
- D.Diffie-Hellman✓
Correct answer: D
Diffie-Hellman is a key exchange protocol specifically designed to allow two parties to establish a shared secret key over an untrusted, public channel without having previously shared any secret information. AES-256 is a symmetric encryption algorithm that requires a shared key to already exist. SHA-256 is a hashing algorithm, not used for key exchange. RSA can be used for key exchange but is not specifically designed for this purpose the way Diffie-Hellman is — DH is the canonical answer for negotiating a shared secret over an insecure channel.
Question 10easy
An administrator examines a digital certificate and notices fields for the subject, issuer, public key, validity dates, and Subject Alternative Name (SAN). Which certificate standard defines this format?
- A.X.509✓
- B.PKCS#12
- C.PEM
- D.DER
Correct answer: A
X.509 is the standard that defines the format of public key certificates, including fields such as subject, issuer, public key, validity period, and Subject Alternative Names (SANs). PKCS#12 is a file format used to bundle a certificate with its private key, not a certificate structure standard. PEM and DER are encoding formats used to store certificate data, not the structural standard that defines certificate fields.