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.
gpg --decrypt secret.txtIncorrect. --decrypt performs decryption.
gpg --export secret.txtIncorrect. --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.
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
Host key
A server identity key used by SSH clients to detect a changed endpoint.
User key
A key pair used to authenticate a user to an SSH server.
Port forwarding
An SSH tunnel that carries traffic between a local, remote, or dynamic endpoint.