LinuxQuestions.org
Visit Jeremy's Blog.
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 05-12-2007, 06:04 AM   #1
drmjh
Member
 
Registered: Mar 2005
Location: North Carolina, USA
Distribution: Ubuntu 12.04LTS
Posts: 264

Rep: Reputation: 31
Can't decrypt a file; Pgp error Msg. follows


Hi,
This should be a quick/easy one. I encrypted a couple of files and decrypted them immediately after to see if the system worked. It functioned flawlessly.
I then encrypted a few important files, destroyed the originals and forgot about them. Today, I needed one of the files as a reference and I was unable to decrypt it. This is the error msg:

"gpg: WARNING: unsafe permissions on homedir `/home/mathay/'
[GNUPG:] ENC_TO 43E8EA1B7F313FDD 16 0
gpg: encrypted with ELG-E key, ID 7F313FDD
[GNUPG:] NO_SECKEY 43E8EA1B7F313FDD
[GNUPG:] BEGIN_DECRYPTION
[GNUPG:] DECRYPTION_FAILED
gpg: decryption failed: secret key not available
[GNUPG:] END_DECRYPTION"

Last edited by drmjh; 05-12-2007 at 03:31 PM. Reason: .png file not was not uploaded; txt was substituted
 
Old 05-12-2007, 04:30 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
Quote:
Originally Posted by drmjh
gpg: decryption failed: secret key not available
Do you have your secret key? Try looking at the output of gpg -K to see if one matches the ID of the key with which your file was encrypted. If not, find it (perhaps you moved homedirs or misplaced $HOME/.gnupg/secring.gpg).
 
Old 05-13-2007, 08:33 AM   #3
drmjh
Member
 
Registered: Mar 2005
Location: North Carolina, USA
Distribution: Ubuntu 12.04LTS
Posts: 264

Original Poster
Rep: Reputation: 31
Thanks for answering.

This is my result: The key 'sub' matches.

mathay@linux:~> gpg -k
/home/mathay/.gnupg/pubring.gpg
-------------------------------
pub 1024D/307E20F4 2007-01-23
uid matthew hayes <24mm@eircom.net>
sub 1024g/7F313FDD 2007-01-23

drmjh

Last edited by drmjh; 05-13-2007 at 08:34 AM.
 
Old 05-13-2007, 10:42 AM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 70
Quote:
Originally Posted by drmjh
mathay@linux:~> gpg -k
/home/mathay/.gnupg/pubring.gpg
This is your public keyring (which seems rather empty). I said -K not -k. Execute:
Code:
$ gpg -K
to list your secret keys. (Note, it will not list them in a way that violates your privacy if you post it here. You dont have to post it if you dont want to just look for the matching ID.)
 
Old 05-13-2007, 12:25 PM   #5
drmjh
Member
 
Registered: Mar 2005
Location: North Carolina, USA
Distribution: Ubuntu 12.04LTS
Posts: 264

Original Poster
Rep: Reputation: 31
mathay@linux:~> gpg -K
/home/mathay/.gnupg/secring.gpg
-------------------------------
sec 1024D/307E20F4 2007-01-23
uid matthew hayes <24mm@eircom.net>
ssb 1024g/7F313FDD 2007-01-23

Sorry about the lowercase err. I continually fall for that in Linux!

Above is the result of -K

I only established one key and I encrypted a test file on my desktop with that a few days ago. I have been decrypting it successfully daily since.
 
Old 05-15-2007, 03:39 PM   #6
drmjh
Member
 
Registered: Mar 2005
Location: North Carolina, USA
Distribution: Ubuntu 12.04LTS
Posts: 264

Original Poster
Rep: Reputation: 31
File decryption problem

I think I may have the reason my decryption failed.
I noticed a (Key file-change)date discrepancy between the original file I encrypted and the last files I encrypted. Although I only ever created one key, several months after the creation, I signed the key.
The original file was encrypted with the unsigned key and I'm trying to decrypt it with a signed key
Thanks for your help, using the gpg -K, gave me the clue. (assuming I'm correct)
drmjh
 
Old 05-15-2007, 06:46 PM   #7
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
Signing a key should have no effect on its ability to encrypt or decrypt. You may want to fix the permissions on your home directory and your .gpg sub-directory. GPG may be ignoring the keys there on encrypt/decrypt operations until they are fixed.

Look at man gpg for info on specific permissions.
 
Old 05-17-2007, 02:48 PM   #8
drmjh
Member
 
Registered: Mar 2005
Location: North Carolina, USA
Distribution: Ubuntu 12.04LTS
Posts: 264

Original Poster
Rep: Reputation: 31
file decryption problem

Thanks for your response, Matir.
I chown /home to myself. Since this is a single user system, I didn't think it was that dangerous to do that and it was quicker than figuring out setuid.
That sorted the permission problem for home and sub dirs.
But, I still get the same Err Msg. I located the .gpg dir, it's in root ~
I somehow don't think it would be prudent to change permissions here. Besides, I'm beginning to think that Err Msg. about permissions is a very frequent and perhaps spurious/non specific Err. Msg. The man pages even has a command to suppress this Msg. I think I'll just delete the key and start over. I won't be able to open the one file that I'm interested in but it might prove to be an easier solution.
Thanks for your help.
drmjh.

Last edited by drmjh; 05-18-2007 at 02:37 PM.
 
  


Reply

Tags
file


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
Passing groupadd to execv() returned error msg: "file already locked." walwali Programming 9 11-22-2010 07:36 AM
How can I decrypt a tar.gz.bf BACKUP FILE? I have the password. Balarabay1 Linux - Software 4 10-02-2006 01:42 PM
i got this error msg NTLDR file missing approvoi Mandriva 4 12-03-2004 08:53 PM
Need help to decrypt error messages jfi Mandriva 1 03-09-2004 12:30 PM
slooze error: validateInputs(); $msg = $mySlooze->renderPage($vars); echo $msg; ?> rioguia Linux - Software 0 01-26-2003 09:59 PM


All times are GMT -5. The time now is 02:52 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration