LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GPG Encryption Problems in Kmail (https://www.linuxquestions.org/questions/linux-newbie-8/gpg-encryption-problems-in-kmail-419705/)

TatforTit 02-26-2006 07:40 AM

GPG Encryption Problems in Kmail
 
Hi.

This may be a silly question, but I am having a problem with GPG inside of Kmail. I have already installed GPG, generated a key, signed it and imported it into Kmail via the "Security" setup options. My problem is whenever I send myself an encrypted email, just as a test, when I try to read the received mail, I get a large error message inside the email saying the file cannot be decrypted. I am probably missing something minor, but I have spent a couple hours trying to figure out why I can't decrypt my own email with my own key. It doesn't even prompt me for my password, it just says the encryption plug-in could not decrypt the message.

Thoughts?

Tinkster 02-26-2006 01:23 PM

Hi,

Couple of questions:

Which version of KDE/KMail are you using?

Is your GPG-Agent process running?


Cheers,
Tink

TatforTit 02-26-2006 05:42 PM

I am using Mandriva 2006, so I think the Kmail version is 1.8. As for gpg-agent that is another thing, whenever I go to the command line I get a message saying gpg-agent is not running, but I am pretty sure it is installed. Maybe I just need to reconfigure gpg-agent?

Tinkster 02-26-2006 06:03 PM

The thing is that you need to start the agent, and then (from the
same shell!) start kmail. Make a script like
Code:

#!/bin/bash
eval "$(gpg-agent --daemon)"
kmail --check $1 > /dev/null 2>&1 && "skill -9 gpg-agent"

and use that to start KMail ...


Cheers,
Tink

TatforTit 02-26-2006 06:27 PM

I tried that script twice and it started kmail but still I get the message when I look at the encrypted email of "Encrypted Data Not Shown" and it says the "crypto-plug-in failed." Maybe I don't have gpg-agent installed afterall. Is there a way to check? When I go to the terminal and enter: "gpg-agent" I get the following reply:


PHP Code:

can't connect to '/home/me/.gnupg/S.gpg-agent': no such file or directory
gpg-agent: no gpg-agent running in this session 


If it isn't installed, is there a quick link from where I can download an rpm?

TatforTit 02-26-2006 06:46 PM

OK, I just checked and gpg-agent is indeed running. I sent myself another email encrypted and I still get the message:

Encrypted message (decryption not possible)
Reason: Crypto plug-in "openpgp" could not decrypt the data.
Error: Decryption failed
Encrypted data not shown.
End of encrypted message


Maybe I need to change settings inside of Kmail itself? The problem is I cannot find recent tutorials for Kmail 1.8.

Tinkster 02-26-2006 06:52 PM

The agent is actually part of GNU PG ... (if you're using GPG 1.9 or
above) or separately available for older GPGs ... no idea about the
RPMs, I'm compiling these things :}

As for the "being installed" ... does
which gpg-agent
return anything?
Or a locate gpg-agent?



Cheers,
Tink

Tinkster 02-26-2006 06:54 PM

Well, obviously GPG and GPG aren't the same. Look at the settings
in KMail again...


Cheers,
Tink

TatforTit 02-26-2006 06:58 PM

First, let me say thanks for all of your replies, Tinskter.

As for the command "which gpg-agent"

I get the following return:
PHP Code:

/usr/bin/gpg-agent 

So, I suppose gpg-agent is indeed "located" and "installed." Any other suggestions? I have generated a public and private key, have the key inside of Kmail signed, have gpg-agent running. What am I missing?

TatforTit 02-26-2006 07:07 PM

Quote:

Well, obviously GPG and GPG aren't the same. Look at the settings
in KMail again...
Are you saying GPG and OpenPGP are not the same? In Kmail when you go to the security tab and look at "crypto backends" mine has two listed:

OpenPGP (gpg)
S/MIME (gpgsm)

in exactly that format. According to Kmail, OpenPGP is GPG.

Tinkster 02-26-2006 09:06 PM

You're most likely using the latter. And indeed, OpenPGP and GPG
are quite distinct.


Cheers,
Tink

TatforTit 02-26-2006 09:24 PM

Ok, thanks for clarifying that.

Is there any way to get the gpg I have installed to work with Kmail? If not should I get OpenGPG? If I need to do that, can you tell me quickly how to "uninstall" GPG (if I need to) when I install OpenGPG? Also, will my current key be compatible?

Thanks in advance.

Tinkster 02-26-2006 10:15 PM

Which version of gpg have you got installed?

gpg --version

And: what do you think of the idea of me moving this thread
to the mandriva forum? Maybe others who suffer(ed) from this can
help you better than someone whose install in slack works?



Cheers,
Tink

TatforTit 02-27-2006 12:02 AM

Sure, moving the thread is fine.

My version of GPG is 1.4.2.

I opened the RPMDrake utility on Mandriva and it has an option to see what software you currently have installed. It appears I have two versions of GPG installed. The packages are as follows:

gnupg2.1.9-16-4mdk
gnupg-1.4.2-2mdk

The summary and description is identical on both, it reads:

Quote:

Summary: GNU privacy guard - a free PGP replacement

Description: GnuPG is GNU's tool for secure communication and data storage. It can be used to encrypt data and to create digital signatures. It includes an advanced key management facility and is compliant with the proposed OpenPGP Internet standard as described in RFC2440.
The last line is what confused me relative to what you said earlier. It says here that gpg is "complaint" with OpenPGP.

Maybe I need both of these packages or maybe one needs to be uninstalled? I really have no idea since it seems whenever I install new software that the rpmdrake utility often says it needs to install other supporting files. Maybe one package works in a supporting role with the other?

craigevil 02-27-2006 11:04 AM

Having the same problem.

PCLinuxOS .92
gpg (GnuPG) 1.2.5
KDE 3.5.1
kernel 2.6.12-oci6.mdk-i586-up-1GB

I get the exact same msg:
Encrypted message (decryption not possible)
Reason: Crypto plug-in "openpgp" could not decrypt the data.
Error: Decryption failed
Encrypted data not shown.
End of encrypted message

gpg-agent IS running.
Even tried opening the msg.asc with Kgpg and nothing happens.


All times are GMT -5. The time now is 03:04 AM.