Unable to encrypt gedit text files etc with PGP

Asked by David Jones

Updated to the latest version of Unbuntu 11.10, have seahorse installed and made keys etc for PGP.

I open up gedit>preferences>plugins but no external PGP plugin is available.

According to various how to's, an external plugin should be available to be checked in preferences in order to encrypt/decrypt text files, but no such option is available.

Very new to Linux, so everything is still a little foreign, any help would be greatly appreciated.

Thanks.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu gedit Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Curtis Hovey (sinzui) said :
#1

Per https://answers.launchpad.net/ubuntu/+source/gedit/+question/171833 seahorse-plugins in oneiric does not provide the needed gedit plugin. This is because The plugin had not been updated to Gtk3 yet. This same question describes how a to register an external tool to call the gpg command line.

Gedit does not have an official PGP/GPG plugin. The plugin registry page http://live.gnome.org/Gedit/Plugins does not list a PGP/GPG plugin.

Revision history for this message
David Jones (david-jones90028) said :
#2

Hi, thanks for the quick response. I followed the instructions as the post stated, but got the error:

gpg: Invalid Option "--no-tty-"

Revision history for this message
Curtis Hovey (sinzui) said :
#3

The stdin arg (-) is concatenated to the option (--no-tty). Add a space after the y
  --no-tty -

Revision history for this message
David Jones (david-jones90028) said :
#4

Awesome, it worked! I'm still a little confused though. I ran clearsign, and this happened:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

test 123
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iF4EAREIAAYFAk9Q75YACgkQAklLQBHXVRJB/QEAnJOyhSAWQZ63V5h+CU3zBFMy
EwgQN//jZLzW2kQd8joBAJkAPrMWccZfWcNCi6yK2b+m92Hw8wUCoFdFiH8u0Q+H
=Hq/A
-----END PGP SIGNATURE-----

And the message that was to be encrypted is shown under Hash: SHA256? Am I missing something?

Thanks

Revision history for this message
Curtis Hovey (sinzui) said :
#5

There is one or more additional steps you may want to take. This command clearsigned text that could then be pasted into an email or sent as a file.

You can create other commands like this one by replacing the --clearsign option with another option.
The --decrypt will decrypt will the open file
The --encrypt will encrypt the open file
So you might want three different commands.

Revision history for this message
David Jones (david-jones90028) said :
#6

OK, I think I understand. So the part I put in the email would be underneath the test123 section:

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iF4EAREIAAYFAk9Q75YACgkQAklLQBHXVRJB/QEAnJOyhSAWQZ63V5h+CU3zBFMy
EwgQN//jZLzW2kQd8joBAJkAPrMWccZfWcNCi6yK2b+m92Hw8wUCoFdFiH8u0Q+H
=Hq/A-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iF4EAREIAAYFAk9Q75YACgkQAklLQBHXVRJB/QEAnJOyhSAWQZ63V5h+CU3zBFMy
EwgQN//jZLzW2kQd8joBAJkAPrMWccZfWcNCi6yK2b+m92Hw8wUCoFdFiH8u0Q+H
=Hq/A
-----END PGP SIGNATURE-----
-----END PGP SIGNATURE-----

This would be the encrypted test123 correct?

Also tried the --decrypt/--encypt as follows:

gpg --encrypt --no-tty -

but this error came up:

gpg: Sorry, no terminal at all requested - can't get input

Revision history for this message
David Jones (david-jones90028) said :
#7

Bit confusing on the last post, just enter the text encrypted under test123:

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iF4EAREIAAYFAk9Q75YACgkQAklLQBHXVRJB/QEAnJOyhSAWQZ63V5h+CU3zBFMy
EwgQN//jZLzW2kQd8joBAJkAPrMWccZfWcNCi6yK2b+m92Hw8wUCoFdFiH8u0Q+H
=Hq/A
-----END PGP SIGNATURE-----

Revision history for this message
Curtis Hovey (sinzui) said :
#8

oh dear. I forgot that those command need password and key selection. This can still be done using an external tool, but something like zenity is needed to collect the input and key selection. Let me think about this for a day because I think this needs a helper script that I believe I can write.

Revision history for this message
David Jones (david-jones90028) said :
#9

That would be great! Thank you. And just so I'm sure before I send an email, the PGP encryption under test123 is the encrypted message, should I just copy and paste to an email?

Thanks

Revision history for this message
Curtis Hovey (sinzui) said :
#10

Yes. you could just paste the text into the email. Now if this is just about email, you may not need a gedit plugin. Evolution already support pgp/gpg operations. Thunderbird uses the enigmail plugin to encrypt/decrypt and sign. You might not need a gedit plugin if you are not working with encrypted files on disc.

Revision history for this message
David Jones (david-jones90028) said :
#11

I appreciate all your help.

Revision history for this message
Sam_ (and-sam) said :
#12

Another alternative would be geany (universe repo) and geany-plugins which incl. geany-plugin-pg.
http://geany-plugins.sourceforge.net/geanypg.html

Revision history for this message
Ignacio Huerta (iox8) said :
#13

I had to fight a bit to find the right syntax in the external tools menu, so I posted it to AskUbuntu: http://askubuntu.com/questions/116996/how-do-i-encrypt-decrypt-file-within-gedit

Revision history for this message
Pietro Battiston (toobaz) said :
#14

Some autopromotion/request for feedback:
http://pietrobattiston.it/gedit-crypto

(notice I developed this also because I was not able to use the "External tools" method without including in clear the password for my key - which I didn't want to).

Can you help with this problem?

Provide an answer of your own, or ask David Jones for more information if necessary.

To post a message you must log in.