Skip to content

Instantly share code, notes, and snippets.

@lmammino
Created April 4, 2013 10:04
Show Gist options
  • Save lmammino/5309234 to your computer and use it in GitHub Desktop.
Save lmammino/5309234 to your computer and use it in GitHub Desktop.
"Encrypt Document" integration for Gedit (compatible with textmate text encryption/decription)
#!/bin/sh
pw=`zenity --entry --hide-text --title="Encrypt document" --text="Insert key"`;
openssl enc -e -aes128 -base64 -pass "pass:$pw";
@Joe-theDevel
Copy link

APRIL 2023 UPDATED SOLUTION !

ENCRYPT WITH GEDIT, THE EASY WAY...

1.- INSTALL SEAHORSE PLUGIN:

sudo apt-get install gedit-plugins seahorse

2.- OPEN GEDIT

3.- CLIC "Text Editor" MENU (left side)

4.- CLIC "Manage External Tools" OPTION

5.- CLIC + TO CREATE (ADD) A NEW GEDIT "SCRIPT" (a.k.a "TOOL")

6.- WRITE YOUR CODE (OR COPY MINE BASED ON "openssl") FOR ENCRYPT (OR DECRYPT)

NOTE: FOR EACH "TOOL" YOU NEED AN ADDITIONAL SCRIPT

6.1.- MY CODE FOR ENCRYPT:

openssl enc -e -pbkdf2 -aes256 -base64
-pass "pass:$(zenity --entry
--title="ENCRYPT" --text="create password")";

6.1.- MY CODE FOR DECRYPT:

openssl enc -d -pbkdf2 -aes256 -base64
-pass "pass:$(zenity --entry
--title="DECRYPT" --text="password")";

7.- CONFIGURE EACH OF THE PREVIOUS "TOOLS" INPUT/OUTPUT SELECTING THE CORRECT OPTIONS FOR "SELECTED" OR "DOCUMENT" TYPE OF USE

TO EXECUTE THE SCRIPTS (TOOLS):

OPEN ANY DOCUMENT TEXT IN GEDIT AND TRY CLICKING THE (3HORIZONTAL BARS) MENU (right side) THEN CLIC OPTION "TOOLS/EXTERNAL TOOLS" THEN CLIC YOUR ENCRYPT SCRIPT... (IF YOU CHOOSE "SELECTED" IN STEP 7 THE YOU NEED TO SELECT SOME SECTION OF THE TEXT BEFORE EXECUTING THE ENCRIPTION OR DECRYPTION

REFERENCES:

From "GNOME.ORG" : Gedit Plugins ExternalTools
https://wiki.gnome.org/Apps/Gedit/Plugins/ExternalTools

From "DEV.TO" : Testing ExternalTools
https://dev.to/daimessdn/testing-gedit-external-tools-for-executing-codes-50ca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment