Ubuntu: How can I do inline encryption system wide?


Inline GPG encryption in Mac OS is system wide. Having installed GPG app, you can select a chunk of text in any text editor and rightclick to encrypt. I am wondering if I am missing some software that would do the same in Ubuntu. At the moment Geany is the only editor that allows this operation (as long as the plugin is installed). I am using Gnote a lot and it is frustrating to have to repeatedly switch to Geany to encrypt.


This can indeed be done by gedit. Install gedit plugins and enable them from preferences. Then go to Tools>Manage External Tools. Then create shortcut keys for, one encrypting and one for decrypting.

For encrypting the script is as follows:

#!/bin/bash  gpg2 -a -e  -r email1@email1.com -r email2@email2.com --no-tty   

email1 etc are public key IDs to which you are encrypting, you can put one or as many as you like. They don't have to be email addresses. Any other form of valid gpg key ID could be used.

For decrypting, the script is:

#!/bin/bash  gpg2 --decrypt --no-tty  

In the lower part of the script window you can set your input and output options from dropdown menues.

For example your input could be a section or the whole of the current document, and your output might be to replace it by the converted text. You might like to save the converted text into another file. So the choice of where your input is and where your output needs to go is important and must be defined as part of the shortcut key action.

It makes sense to have different shortcut keys depending on your choice of input and output. This will save you having to edit the conditions everytime you have a different I/O.

For INLINE (or replacement) encryption/decryption, which was the original question for this post. I have defined S-ENCRYPT and S-DECRYPT shortcuts with these conditions:

Input: the current Selection Output : replace The current selection

Of course I also have two other shortcut keys (ENCRYPT and DECRYPT) whose i/o conditions are: Input: Current document Output: Append to current document

The script for all these shortcut keys is identical (as given above).

The original thread abouthow to do all this appeared in: How do I encrypt/decrypt file within gedit?

Sadly I could not replicate that result, perhaps due to old/new versions of both gedit and gpg. But that thread has good description of how the process works.


It depens of what you mean by "Inline encryption". On Ubuntu and other flavours, you have 2 types of encryption :

  • Encrypt home folder

  • Encrypt the whole disk

If it's only for files like text files, I know it exists some software that do the trick

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »