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.

  • What is 'inline GPG encryption'? Did you mean 'online'? – anonymous2 Sep 1 '16 at 19:05
  • I don't think you can encrypt kernel programs and drivers but you can keep your data on a separate portion and encrypt the whole volume. At least you could in Ubutu 14.04. – WinEunuuchs2Unix Sep 1 '16 at 19:47
  • inline encryption is when you highlight a portion of your text and make it unreadable. The recipient of the text highlights the unreadable portion and uses a valid key to convert it back to plain text – elmclose Sep 1 '16 at 19:58
  • I see what you mean. But I don't think you'll be able to have a right-click menu in all apps. But is a keyboard shortcut okay? – UniversallyUniqueID Sep 8 '16 at 14:43
  • you are quite right, this solution is for gedit only. I forgot that my original question about system-wide was a bit ambitious. I guess as long as we can copy/paste the text into gedit we are fine – elmclose Sep 8 '16 at 14:47

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:

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:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.