LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-23-2011, 02:04 PM   #1
lcharles
LQ Newbie
 
Registered: Dec 2011
Posts: 9

Rep: Reputation: Disabled
Decryption failed: Kgpg


Kgpg was running fine in Kubuntu 11.04. I upgraded to ll.10. I can encrypt with gpg/pgp keys. If I encrypt a file with my key I can't decrypt it. If someone encrypts a file with my public key I can't decrypt it. I can decrypt the file in Windows (using the same key pair and the same file).

If I try to decrypt the same file in a Konsole I get the following:

You need a passphrase to unlock the secret key for
user: (user info)

gpg: problem with the agent - disabling agent use
Enter passphrase:

I enter the pass phrase and get a lot of weird ASC characters, no message, and no decryption.

So what's the first step in sorting this out? Is there other information I should post here that would help?
 
Old 12-24-2011, 11:42 AM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
I think you're seeing the "weird [ASCII] characters" because output is being sent to stdout. Try again from the shell prompt (e.g. Konsole), but this time use:

Code:
$ gpg --output clear.txt --decrypt cipher.txt
(where "cipher.txt" is, of course, the encrypted file)
 
Old 12-24-2011, 12:21 PM   #3
lcharles
LQ Newbie
 
Registered: Dec 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
Using the command you provided I don't get anything new, just the following:


user@~/Documents$ gpg --output clear.txt --decrypt tester1.doc.pgp

You need a passphrase to unlock the secret key for
user: user
default key

gpg: problem with the agent - disabling agent use
gpg: encrypted with 1024-bit RSA key, ID ...

gpg: encrypted with 2048-bit ELG-E key, ID ...
...
gpg: WARNING: message was not integrity protected
user@~/Documents$


It doesn't make any difference if I encrypt with the only the new key or both the old (RSA) key and private new key. This file was obviously encrypted with both.
 
Old 12-24-2011, 12:32 PM   #4
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Did you view clear.txt after running that command?
 
Old 12-24-2011, 01:24 PM   #5
lcharles
LQ Newbie
 
Registered: Dec 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
Sorry, yes, the output looks pretty similar to the first time. The few recognizable words are:


Microsoft Word-Dokument.

Mostly the space is filled with vertical rectangles that won't copy and paste to here.
 
Old 12-24-2011, 09:50 PM   #6
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Almost sounds like a locale problem, but GnuPG should not mess with character sets while encrypting or decrypting.

Let's take the whole process from the top. Encrypt it:
Code:
$ gpg --encrypt --armor tester1.doc
(then choose the public key associated with the recipient)

Then decrypt again:
Code:
$ gpg --output tester1.clear.doc --decrypt tester1.doc.gpg
Is that run successful? It seems unlikely that it's a key pair problem (unless they somehow became corrupted while importing). Something about the way GnuPG is being used on Kubuntu is not correct -- could be a user error, or could be a legitimate Kubuntu problem. (I'm inclined to say the latter! It was working OK for you on 11.04.)
 
Old 12-26-2011, 12:12 PM   #7
lcharles
LQ Newbie
 
Registered: Dec 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
I ran what you suggested. It seems to work. Here's what came up in the output of the shell prompt:


larrylaca1@~$ gpg --encrypt --armor testing1.doc
You did not specify a user ID. (you may use "-r")

Current recipients:

Enter the user ID. End with an empty line: (I entered my user ID)

Current recipients:
-My key ID

Enter the user ID. End with an empty line: (I just hit enter here)
larrylaca1@~$ gpg --output testing1.clear.doc --decrypt testing1.doc.asc

You need a passphrase to unlock the secret key for
user: (my user ID)
(my Key ID)

gpg: problem with the agent - disabling agent use
gpg: encrypted with 2048-bit ELG-E key, ID (my ID)

larrylaca1@~$

So I got the file to decrypt. Which means that (I guess) gpg agent isn't needed? Or is it for Kgpg? I don't have much depth of knowledge with Linux. Would you mind explaining a bit more what just happened, why you think Kgpg is giving me trouble, and if (as it now seems) this is a problem with Kubuntu, how I get some help from someone who is proficient with that version of Linux? I make the last request because I have posted the problem on the forum there and while I have gotten some thoughtful responses they are not from people who seem to know a lot more than I do.
 
Old 12-27-2011, 12:16 AM   #8
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
The main purpose of gpg-agent is to cache your private key passphrase. If that's not a crucial feature to you, then it's not needed.

Command-line GnuPG is working fine for you, so we can eliminate it (and your keypair) as possible problem culprits. Make sure your Kubuntu system is up to date with the latest packages, and hit up their forums if the Kgpg problem persists...
 
Old 12-27-2011, 10:58 AM   #9
lcharles
LQ Newbie
 
Registered: Dec 2011
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanks for your help. I'll give it another try on Kubuntu forums.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gpg: decryption failed: secret key not available edhe1 Linux - Security 4 03-08-2011 07:07 PM
Using the Kgpg and GNUpg vitalstrike82 Linux - Newbie 2 04-20-2009 01:29 PM
need some help with kgpg zebra90210 Linux - Software 3 06-27-2006 01:17 AM
Decryption suddenly failed Recirqie Linux - Wireless Networking 1 02-10-2006 12:32 PM
problem with kgpg fkissig Linux - Software 0 02-25-2005 08:04 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration