Encrypt secret information with GnuPG using symmetric encryption while keeping the input file and creating ciphertext.
Which command is appropriate?
gpg --symmetric performs passphrase-based symmetric encryption.
Detailed explanation
gpg --symmetric secret.txtCorrect. --symmetric encrypts the file with a passphrase.
Correct. --symmetric encrypts the file with a passphrase.
gpg --decrypt secret.txtIncorrect. --decrypt performs decryption.
Incorrect. --decrypt performs decryption.
gpg --export secret.txtIncorrect. --export writes keys such as public keys; it does not encrypt a file.
Incorrect. --export writes keys such as public keys; it does not encrypt a file.
gpg --verify secret.txtIncorrect. --verify checks a signature rather than encrypting data.
Incorrect. --verify checks a signature rather than encrypting data.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' 'gpg --symmetric secret.txt'Expected result
gpg --symmetric secret.txtKey points
- --symmetric
- --decrypt
- Signature verification
Notes
- Environment: GnuPGのコマンド役割確認
- 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.