User Tools

Site Tools


home:computing:linux:gpg

Table of Contents

[up]

gpg

keys

First, create a key pair to identify yourself:

gpg --full-generate-key

This will ask for a user name and e-mail address, and the keys will be coupled to that e-mail address.

Now, export the public key so you can publish it.

gpg --armor --export EMAIL-ADDRESS > public-key.gpg

Anyone who wants to encrypt something for you needs to import your public key:

gpg --import public-key.gpg

encryption

Now people with your key can encrypt data for you:

gpg -r EMAIL-ADDRESS -e FILE-TO-ENCRYPT

This will create an encrypted file FILE-TO-ENCRYPT.gpg that they can send you.

decryption

The data can be decrypted by whoever owns your private key (hopefully only yourself; just in case, make sure to use a non-empty passphrase when you create your keys):

gpg FILE-TO-DECRYPT.gpg
home/computing/linux/gpg.txt · Last modified: 21:28 01/02/2025 by acz

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki