Share this page: Follow me to be notified of new articles:


What is it?

With dirGPG you can easily crypt and decrypt a folder with GPG

What do I need?

  1. A PC with Linux or a Mac
  2. GPG installed (learn more)
  3. You need to know how to use the terminal

What can I do with the source code?

What ever you want. (learn more)
Would you like to improve it? If you want, send me the updated version and if you want, I'll publish it here. (contact me)

How do I use it?

Symmetric encryption vs public key / private key encryption

The default encryption mode in dirGPG is the symmetric encryption, which means that you can set up a different password for each encrypted folder. If you send the folder to someone else, you'll just have to give him the password.
You can easily change this behavior for a public-key / private-key encryption when you encrypt the document and select the recipients with their public key. They'll be able to decrypt the document with their private key. (Read more about GPG encryption mode in my article)
To use a public key / private key encryption, just replace the following line in the script :
gpg -cv --output ".gpg" ".tar";
With this one :
gpg --encrypt --output ".gpg" ".tar";


Source code

Save it with a text Editor like emacs, VIM or nano as "".

Last update of this page: March 27, 2017
Please do not copy any of the content of this website without asking me first.