When you’re sharing data with others, especially between different teams or organizations, it’s common to encrypt files before sending them. That way, only the intended person can unlock and read them. A popular and secure way to do this is with asymmetric encryption. In this setup, you don’t have to exchange secret keys. Instead, one person encrypts the data using the other person’s public key, and the receiver decrypts it using their private key.

 

Today, we’ll walk through how to use PGP (Pretty Good Privacy) to encrypt and decrypt data on macOS. PGP is widely used for securing emails and sensitive files.

There are a few tools out there to help with this, and on macOS, one of the easiest to use is GPGTools. It’s simple to install. Once it’s up and running, launch GPG Keychain—this is where you can create a new key pair or import existing keys that either you or someone else generated. Setting up your keys is the first thing to do before you can start encrypting or decrypting files.

Once your keys are ready and loaded into GPG Keychain, you’ll see them listed like this:

If it says “pub”, that’s a public key.

If it says “sec/pub”, you’ve got the private key too.

To encrypt a file, just right-click (or control-click) on it and look for the Services menu. From there, choose OpenGPG: Encrypt File.

 

If you’re not a fan of GPG Keychain, there are other tools out there too. One example is PGPTool, a Java-based app that comes with that classic Java-style interface.

It’ll then ask you to pick a recipient—basically, whose public key to use for encrypting the file. Once that’s done, you’ll get a new file with the same name but ending in .gpg.

To decrypt a file, it’s pretty much the same process. Right-click it and choose OpenGPG: Decrypt File. If the corresponding private key is in your keychain, the file will decrypt just fine. But if it’s missing, you’ll get an error. In that case, you’ll need to import the right private key.

 

You can also encrypt just part of a file. Open it, highlight the text you want to protect, right-click, and pick the encryption option. The encrypted block will look something like this:

—–BEGIN PGP MESSAGE—–
(encrypted content here)
—–END PGP MESSAGE—–

One thought on “PGP Encrypt or Decrypt a file or text on MacOS

Leave a Reply

Your email address will not be published. Required fields are marked *

2025 Onion Observer

Exploring the darknet. Onion Observer serves guides about privacy, security and cryptocoins and about the TOR network and how to access the hidden services. Sometimes we write about drugs and marketplaces too.