Forrest logo
back to the gpg tool

gpg:tldr:ae34f

gpg: Encrypt and sign `doc.txt` for alice@example.com and bob@example.com (output to `doc.txt.gpg`).
$ gpg --encrypt --sign --recipient ${alice@example-com} --recipient ${bob@example-com} ${doc-txt}
try on your machine

This command uses the "gpg" (GNU Privacy Guard) tool to encrypt and sign a document.

Here is the breakdown of the command:

  • gpg: This is the command to invoke the GNU Privacy Guard tool.

  • --encrypt: This option specifies that the document should be encrypted.

  • --sign: This option indicates that the document should also be digitally signed.

  • --recipient ${alice@example-com}: This specifies "Alice" as the recipient of the encrypted document. The email address ${alice@example-com} is just a placeholder and should be replaced with the actual email address of Alice.

  • --recipient ${bob@example-com}: Similarly, this option specifies "Bob" as another recipient of the encrypted document. Again, the email address ${bob@example-com} needs to be replaced with Bob's actual email address.

  • ${doc-txt}: This represents the file name or path of the document (e.g., document.txt) that you want to encrypt and sign.

In summary, the command encrypts and signs the specified document, ensuring that only Alice and Bob (the recipients) can decrypt and verify the authenticity of the document.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gpg tool