How To Lock Secret Files With GPG

In this guide, I will explain the options at your disposal for encrypting files using open-source software on a Linux, Mac, or Windows computer. You can then transport this digital information across distance and time, to yourself or others.

The program “GNU Privacy Guard” (GPG) an open-source version of PGP (Pretty Good Privacy), allows:

  1. Encryption using a password.
  2. Secret messaging using public/private key cryptography
  3. Message/Data authentication (using digital signatures and verification)
  4. Private key authentication (used in Bitcoin)

Option One

Option one is what I’ll be demonstrating below. You can encrypt a file using any password you like. Any person with the password can then unlock (decrypt) the file to view it. The problem is, how do you send the password to someone in a secure way? We’re back to the original problem.

Option Two

Option two solves this dilemma (how-to here). Instead of locking the file with a password, we can lock it with someone’s public key — that “someone” is the intended recipient of the message. The public key comes from a corresponding private key, and the private key (which only the “someone” has) is used to unlock (decrypt) the message. With this method, no sensitive (unencrypted) information is ever sent. Very nice!