LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-16-2018, 08:53 PM   #1
shwaybotx
LQ Newbie
 
Registered: Mar 2017
Location: Amarillo, T Amateur photographer, published author. Interests: astronomy, political science & freedom of press. Been: 37 countries. Lived: 3 continents.X
Distribution: linux mint mate kfce 18.1
Posts: 7

Rep: Reputation: Disabled
GnuPG backup failure... ooops.


Okay. I need some gpg advice so this doesn't happen again.

I have some webspace on a server and so I had this wonderful, brilliant idea! I was going to gpg encrypt 3 folders on my own computer, then use FileZilla to upload them and store them on my server. Since they were encrypted, it should be good. Kinda like my own private DropBox with unlimited space.

I automated this and did this little procedure once a day and all was good in lala land until the dreaded time came....

I wanted to reinstall Linux (I was bored) and I thought, No problem! My backups are installed safe and sound on my web server site. I'll just redownload them later with FileZilla and unencrypt them!

Well everything went marvelously as planned. I reinstalled my Fedora 27 KDE. I reinstalled FileZilla. I downloaded my encrypted folders from my site... except when it came to the small pesky problem of dencrypting my own pgp folders. At which point I was told I could not. The exact error message was:
Code:
$ gpg -d Documents-zip.asc
gpg: can't open `Documents-zip.asc'
gpg: decrypt_message failed: file open error
What is the correct way to do this so it doesn't happen to me again? I'm assuming it's because I didn't have a backup of my public and private keys. Is that correct?
 
Old 03-17-2018, 06:41 AM   #2
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,620
Blog Entries: 40

Rep: Reputation: Disabled
Quote:
Originally Posted by shwaybotx View Post
gpg: decrypt_message failed: file open error[/code]
I bet this is not a problem with cryptography.
Have you checked the rights on the file that you try to decrypt?

Secondly. When you install Linux and want to overwrite an existing system, it helps to have the home directory and possibly all other files which are not needed for the system to function, on separate hard disk partitions. That is what partitioning is all about.

Installing an operating system does never mean to lose your private data, documents, collections.., whatever. On the other hand, when you prefer to keep these data on an external drive, on a remote server (as gentle hosting-services or malicious weasels are eager to provide) or other, then why keep a local copy? At least, you would immediately stumble over any problem with the encryption, should there be one.

There is none, I bet.
 
Old 03-17-2018, 08:03 AM   #3
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
The good news is, I think: file open error probably means exactly what it says. Check permissions and triple-check your command line. If the key was missing or wrong, GPG would tell you that, not this.

I keep my most critical cipher keys on non-volatile media such as CD-ROMs as well as memory sticks which are kept locked in a fire-safe.
 
Old 03-18-2018, 04:37 AM   #4
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,620
Blog Entries: 40

Rep: Reputation: Disabled
... I forgot one more thing, yesterday.

If you use encryption to protect files that only you will access to, afterwards, let's say in exactly the way that the OP described, above (for example), symmetric encryption is most appropriate. All the same, you may choose a key-file in this case and might run into trouble when you lose it.

But even if you content with a nicely composed passphrase, symmetric encryption (option -c to gnupg) is alright in most cases, where you do not need to communicate data to other people.

(There had been a short exchange on LQ where someone stated and wanted to impose the contrary. But I am right and she/he was wrong. Foll Stop. Look it up in case of doubt. It is in the book right beside the Grimms' tales and a better read, anyway. Believe me.).

Last edited by Michael Uplawski; 03-18-2018 at 04:40 AM.
 
Old 03-18-2018, 07:32 PM   #5
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Rep: Reputation: 78
Quote:
Originally Posted by shwaybotx View Post
Well everything went marvelously as planned. I reinstalled my Fedora 27 KDE. I reinstalled FileZilla. I downloaded my encrypted folders from my site... except when it came to the small pesky problem of dencrypting my own pgp folders. At which point I was told I could not. The exact error message was:
Code:
$ gpg -d Documents-zip.asc
gpg: can't open `Documents-zip.asc'
gpg: decrypt_message failed: file open error
What is the correct way to do this so it doesn't happen to me again? I'm assuming it's because I didn't have a backup of my public and private keys. Is that correct?
I'm a gpg noob myself, so take what I say with a grain of salt.

"file open error" -- this may just be an issue of file permissions. I will point out that, when decrypting files, you should generally specify an output file name or GPG will simply dump the decrypted output to your terminal window. You might consider this command:
Code:
gpg -o Documents-zip -d Documents-zip.asc
It's my understanding that gpg would search for the appropriate key in your gpg key ring. If you failed to back up this key, you are s.o.l.. If you made a backup of the keys, you'll need to import them (at the very least your private key) to your key ring before trying to decrypt anything that was originally encrypted with them.
 
  


Reply



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
KGpg-versus terminal : how to backup the keys - with entire "~.gnupg/" directory sayhello_to_the_world Linux - Newbie 3 12-16-2013 05:10 AM
[SOLVED] Failure restoring a cpio backup from tape dguy Linux - Server 10 03-29-2009 09:12 AM
Preparing For F7 - Best way to backup gnupg & everything else? nomb Fedora 2 05-30-2007 11:35 AM
robots.txt file ooops!...or bot ooops?!?! vous Linux - Software 1 05-15-2007 10:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:42 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
Open Source Consulting | Domain Registration