LPIC-2 System Security Practice Question
An administrator wants to encrypt a file so that only a specific recipient can decrypt it. Which GPG command should be used?
⚠ Common exam trap
Candidates often confuse `--symmetric` (shared passphrase) with `--encrypt --recipient` (public-key encryption), or assume that signing (`--sign` or `--clearsign`) provides confidentiality when it only provides authentication and integrity.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
gpg --encrypt --recipient key-id file
The `--encrypt` flag with `--recipient key-id` uses the recipient's public key to encrypt the file, ensuring that only the holder of the corresponding private key can decrypt it. This is the standard asymmetric encryption workflow in GPG for targeted confidentiality.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
gpg --encrypt --recipient key-id file
Why this is correct
This encrypts the file for the specified recipient's public key.
- ✗
gpg --symmetric file
Why it's wrong here
Symmetric encryption uses a passphrase, not a recipient's public key.
- ✗
gpg --clearsign file
Why it's wrong here
This creates a clearsigned signature, not encryption for a specific recipient.
- ✗
gpg --sign file
Why it's wrong here
This only signs the file, it does not encrypt.
Quick reference
Asymmetric Encryption Algorithm Comparison
| Algorithm | Key Exchange | Signatures | Equivalent Security Key | Notes |
|---|---|---|---|---|
| RSA-3072 | Yes | Yes | 128-bit | Widely deployed; slow for bulk data |
| ECDSA P-256 | No | Yes | 128-bit | Fast signatures; standard TLS certs |
| ECDH / ECDHE | Yes | No | 128-bit | Perfect forward secrecy in TLS 1.3 |
| DH / DHE | Yes | No | 128-bit (3072-bit key) | Replaced by ECDHE in modern TLS |
| Ed25519 | No | Yes | ~128-bit | SSH keys, modern PKI |
Go deeper
Related to this question
About these practice questions
One of 507 original LPIC-2 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-2 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-2 exam.