How to Create a PGP Key on Ubuntu 24.04 and Decrypt Messages
Encrypting messages is vital to making sure communications are secure. The oldest and still stable method in use today is PGP (Pretty Good…
Encrypting messages is vital to making sure communications are secure. The oldest and still stable method in use today is PGP (Pretty Good Privacy). PGP has been around for some time. You can find goodies and software on https://www.openpgp.org/. However, at the end of the day, the CLI (command line interface) is the easiest over messing with some of these clunky or complicated UI tools.
Launch the Password and Keys app on Ubuntu (It’s native)
Click on the + symbol and select your option according to what your doing. If your signing stuff online or for Github, etc. You can do the SSH Key, but other things you can do the GPG Key. Follow instructions based upon what the site is asking for (This tutorial works for Ubuntu Landscape)
Then you generate your key. I don’t recommend doing anything under 4096 nowadays…
Type your favorite Shrimp password and then boom…now you have your key
Now that you have your key, you need to export it so that you can decrypt your messages. Remember, you need to take a decrypted message and unencrypt it so you will need to download a tool to do so:
sudo apt-get install pgpgpg -y
Export your public key to where you will be working on things. Right-click on the key and Export it to the folder you want to work from (cough..cough…Documents?):
You can show your list of keys by running this command
gpg --list-secret-keys
You will see the following type of output:
rickybobby@bubbashrimp:~$ gpg --list-secret-keys
/home/shea/.gnupg/pubring.kbx
sec rsa4096 2024-05-08 [SC]
3FA34A2AB4140566C2F011B285A9EFDD1F218A0E
uid [ultimate] Ricky Bobby (I like speed and shrimp!) <rickybobby@bubbarocks.io>
ssb rsa4096 2024-05-08 [E]
rickybobby@bubbashrimp:~$
After that you can take the public key of a file that is sent to you and save it into a file:
touch secretshakeandbake-instructions.txt
Open up your favorite editor (cough..vi for warriors…or nano for you scaredycats) and paste in your keys for decryption
Example only..don’t be an idiot and try it ;-)
For more general information on OpenPGP and related tools such as Gnu Privacy
Guard (GPG), please see:
https://help.ubuntu.com/community/GnuPrivacyGuardHowto
-----BEGIN PGP MESSAGE-----
hQIMAyyIoIj2sQXAAQ//cipxLRhI4BTg1dI+q5faRRUX3Sq3m4/Sa5zYKPsuNGd3
6Lc0GLPIstP1gWGs74bCiVekZai0Keap63bO9xHBIdgRzr7YVYLgNnn68uZIY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OXrr8974kb18=
=Fi3y
-----END PGP MESSAGE-----
Thanks,
The Launchpad Team
Run the command to decrypt the file (make sure the private key is there):
pgpgpg -d landscape.txt 'RickyBobby.pgp'
You will then see your message!