So okay. Now we've talked about GPG on Windows and about Protonmail, what about Linux ? That's easy, so let's get moving. This will be command line, so strap yourself in, and let's go.

Okay, first let's install some software and setup some keys.

# install gpg

apt install gpg2

# generate key pair

gpg --gen-key

It's going to ask a lot of question,so go through them one by one, and answer them. When you're done it should have generated your shiny new key-pair. Let's test it.

# List public keys

gpg --list-keys

/home/nx/.gnupg/pubring.kbx
---------------------------
pub   rsa3072 2020-08-09 [SC]
      9CAC5449412C667C
uid           [ ultim. ] NoExecute <This email address is being protected from spambots. You need JavaScript enabled to view it.>
sub   rsa3072 2020-08-09 [E]
sub   rsa4096 2020-08-09 [S]

# List private keys

gpg --list-secret-keys

/home/nx/.gnupg/pubring.kbx
---------------------------
sec#  rsa3072 2020-08-09 [SC]
      9CAC5449412C667C
uid           [ ultim. ] NoExecute <This email address is being protected from spambots. You need JavaScript enabled to view it.>
ssb>  rsa3072 2020-08-09 [E]
ssb>  rsa4096 2020-08-09 [S]

Yep, we have a key-pair. So, now we make a backup, just so we have one.

# Export public key into file

gpg --export you@domain > public.key

# Export secret key into file

gpg --export-secret-key you@domain > private.key

Next, if we wish to import the onto a new machine, we can do it like this.

gpg --import keyfile


To delete keys from our keyring, we can use this

# Delete public key

gpg --delete-key keyid / email

# Delete private key

gpg --delete-secret-key keyid / email

So, now we need to know how to export our public key, and we do that with the command

# Export public key to file

gpg --export -a you@domain > keyfile.asc

# Export secret key

gpg --export-secret-key -a you@domain > private.key

That's all there's to it :) No you can publish your public key on your website, or send it through email, so someone else can use it :)

To use the files in the evolution client on Linux, you need to setup a contact, and in the contact settings, import their public key. You do that in the certifications / certs tab from the contact's details.

 

That's it. Or you can import their public file from the command line using the command

gpg --import keyfile.pub

Have fun :)

You have no rights to post comments