You want to send report.txt to your colleague Alice so that only she can read it, using GnuPG public key cryptography. Which key do you need, and which command uses it?

LPIC-1 Exam 102-500, objective 110. Security medium

Machine-checked — no person has signed for it. This question was read against the source cited below by an automated pass, which found no contradiction. That is a weaker claim than it sounds: the same kind of process wrote the question, so it can confirm its own mistake.

Treat it as a good draft rather than as settled fact, and read the source below before you rely on it. It is not used in mock exams here — only questions a person has signed for are.

How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.

The options

Not correct Your own private key, with `gpg --sign report.txt`

Wrong. Signing with your private key proves the file came from you and has not been altered, but the content is not concealed from anyone who obtains the file.

Not correct Your own public key, with `gpg --encrypt --recipient you@example.com report.txt`

Wrong. Encrypting to your own public key means only you can decrypt the result, since only you hold the matching private key. Alice would be unable to read it.

Not correct A passphrase you both agree on, with `gpg --symmetric report.txt`

Wrong for this question. --symmetric is a genuine gpg mode, but it is conventional shared-secret encryption: it uses no key pair at all and requires you to transmit the passphrase to Alice by some other secure channel.

Correct Alice's public key, with `gpg --encrypt --recipient alice@example.com report.txt`

Correct. You encrypt to the recipient's public key, which you must have imported into your keyring first, and only her matching private key can decrypt the result.

Why

Keep the two directions apart. To encrypt for someone, use their public key; they decrypt with their private key. To sign, use your private key; anyone verifies with your public key. `gpg --encrypt --sign --recipient alice@example.com report.txt` does both, producing a file only Alice can read and that she can confirm came from you. Add --armor to get printable ASCII output suitable for email instead of the default binary. You obtain Alice's key with `gpg --import alice.asc` or from a key server with `gpg --keyserver <server> --recv-keys <keyid>`.

Where this comes from

Cited
LPI exam objective 110.3
What it says
Encrypt and sign files with GnuPG using the correct key of the pair.

Practise this

Reading one question is not practice. The trainer will draw a short set from objective 110 and space the ones you get wrong.

Practise LPIC-1 Exam 102-500

More questions on this objective

All questions on Security

Practise LPIC-1 Exam 102-500