Forrest logo
tool overview
On this page you find all important commands for the CLI tool gpg. If the command you are looking for is missing please ask our AI.

gpg

GPG, also known as GNU Privacy Guard, is a command line tool used for encryption and decryption of data. It implements the OpenPGP (Pretty Good Privacy) standard, which provides cryptographic privacy and authentication for data communication.

Some key features of GPG include:

  1. Encryption and Decryption: GPG uses public-key cryptography to secure communications and files. It can encrypt data using a recipient's public key, ensuring only the intended recipient can decrypt it using their private key.

  2. Digital Signatures: GPG supports creating and verifying digital signatures. By signing a file with your private key, you can provide proof of authenticity, integrity, and non-repudiation. Recipients can verify the signature using your public key.

  3. Key Management: GPG allows you to generate and manage public-private key pairs. Your private key remains secret while sharing the public key with others. It also supports key certification and the creation of keyrings.

  4. Key Servers: GPG integrates with key servers, which act as centralized repositories for sharing public keys. Users can search and retrieve public keys from these servers, making it easier to establish secure communication.

  5. Verification and Trust: GPG helps establish trust between users by using a web of trust model. You can verify the authenticity of a public key by checking the signatures placed on it by other trusted users.

  6. Integration with Email Clients: GPG can be integrated with email clients like Thunderbird or Outlook, enabling secure email communication by encrypting messages and attachments.

It's important to note that GPG is a command line tool, so it requires some familiarity with command line interfaces. However, several graphical user interfaces (GUIs) also exist, making it more accessible to non-technical users.

List of commands for gpg:

  • gpg:tldr:067ca gpg: Sign `doc.txt` without encryption (writes output to `doc.txt.asc`).
    $ gpg --clearsign ${doc-txt}
    try on your machine
    explain this command
  • gpg:tldr:1417a gpg: Export private key for alice@example.com (output to `stdout`).
    $ gpg --export-secret-keys --armor ${alice@example-com}
    try on your machine
    explain this command
  • gpg:tldr:24215 gpg: Create a GPG public and private key interactively.
    $ gpg --full-generate-key
    try on your machine
    explain this command
  • gpg:tldr:7ed74 gpg: Decrypt `doc.txt.gpg` (output to `stdout`).
    $ gpg --decrypt ${doc-txt-gpg}
    try on your machine
    explain this command
  • 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
    explain this command
  • gpg:tldr:d2976 gpg: Export public key for alice@example.com (output to `stdout`).
    $ gpg --export --armor ${alice@example-com}
    try on your machine
    explain this command
  • gpg:tldr:d7e0d gpg: Encrypt `doc.txt` with only a passphrase (output to `doc.txt.gpg`).
    $ gpg --symmetric ${doc-txt}
    try on your machine
    explain this command
  • gpg:tldr:eaf55 gpg: Import a public key.
    $ gpg --import ${public-gpg}
    try on your machine
    explain this command
  • paperkey:tldr:14677 paperkey: Export a specific secret key and generate a text file with the secret data.
    $ gpg --export-secret-key ${key} | paperkey --output ${path-to-secret_data-txt}
    try on your machine
    explain this command
tool overview