Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 358  / 3 Years ago, mon, september 20, 2021, 4:51:30

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.


More From » encryption

 Answers
5

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 [email protected] -r [email protected] --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.


[#13904] Tuesday, September 21, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ampolinhad

Total Points: 88
Total Questions: 100
Total Answers: 116

Location: South Georgia
Member since Tue, Feb 1, 2022
2 Years ago
;