To use Ubuntu GPG keys, follow these steps:
- Open Terminal: You can open the terminal by pressing Ctrl + Alt + T or by searching for "terminal" in the Ubuntu application launcher.
- Generate a New GPG Key Pair: Type in the following command in your terminal to generate a new GPG key pair:
You will then be prompted to enter information about the key such as your name and email address.
- Export Your Public Key: Once you have generated your GPG key pair, you will need to export your public key. To do this, type in the following command:
gpg --export --armor email@example.com > publickey.asc
Replace "firstname.lastname@example.org" with the email address you provided when generating your GPG key pair.
- Share Your Public Key: You can share your public key with others so that they can encrypt files that only you can decrypt. You can send your public key as an email attachment or upload it to a key server.
- Import Public Keys: You can also import other people's public keys to encrypt files that only they can decrypt. To do this, type in the following command:
gpg --import publickey.asc
Replace "publickey.asc" with the filename of the public key you want to import.
- Encrypt Files: To encrypt a file, type in the following command:
gpg -e -r recipientname filename
Replace "recipientname" with the name of the person whose public key you imported and "filename" with the name of the file you want to encrypt.
- Decrypt Files: To decrypt a file, type in the following command:
gpg -d filename.gpg
Replace "filename.gpg" with the name of the file you want to decrypt.