Decrypt report.txt.gpg with the matching private key and write the plaintext to report.txt.
Which command is appropriate?
gpg --decrypt CIPHERTEXT uses the available private key to recover the session key and writes plaintext to the specified output.
Detailed explanation
gpg --output report.txt --encrypt report.txt.gpgIncorrect. --encrypt creates ciphertext rather than decrypting it.
Incorrect. --encrypt creates ciphertext rather than decrypting it.
gpg --output report.txt --decrypt report.txt.gpgCorrect. It decrypts the file to the requested output.
Correct. It decrypts the file to the requested output.
gpg --output report.txt --verify report.txt.gpgIncorrect. --verify checks a signature rather than decrypting data.
Incorrect. --verify checks a signature rather than decrypting data.
gpg --output report.txt --export report.txt.gpgIncorrect. --export handles key data, not ciphertext.
Incorrect. --export handles key data, not ciphertext.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' '--decrypt=decrypt ciphertext' '--output report.txt=write plaintext file'Expected result
--decrypt=decrypt ciphertext
--output report.txt=write plaintext fileKey points
- A private key is required
- Use --decrypt
- Protect the plaintext output
Notes
- Environment: GnuPG decryption構文(復号なし)
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.