A developer needs to securely transmit a sensitive file named api_keys.conf to a colleague. The developer has the colleague's GPG public key in their local keyring. Which of the following commands will encrypt the file so that only the intended colleague can decrypt it?
The correct command is gpg --encrypt --recipient [email protected] api_keys.conf. This uses asymmetric encryption with the colleague's public key to ensure confidentiality. Only the holder of the corresponding private key, the colleague, can decrypt the file. The --sign option provides integrity and authenticity by creating a digital signature with the sender's private key, but it does not encrypt the file's contents. The --decrypt option is the reverse operation, used by the recipient to read an encrypted file, not by the sender to create one. The --symmetric option also encrypts the file, but it uses a single shared passphrase (symmetric encryption) instead of the colleague's specific public key, which was the method indicated by the scenario.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of a GPG public and private key pair?
Open an interactive chat with Bash
How does the `--encrypt` and `--recipient` option in GPG work?
Open an interactive chat with Bash
What is the difference between symmetric and asymmetric encryption in GPG?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Security
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access