LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-29-2015, 01:46 PM   #1
thomas.hedden
Member
 
Registered: May 2006
Location: Carlisle, MA
Distribution: Ubuntu, Fedora
Posts: 60

Rep: Reputation: 16
Importing keys from PGP 8.1 into GnuPG or OpenPGP?


Ten years ago I purchased a license to PGP 8.1 from its original publisher. As luck would happen, I hardly ever used it, and since then I have migrated my OS, etc., and my original installation is no longer available. I want to replace it with a Linux equivalent, and I am hoping that I can still use my old keys, which I still have. First, are the old keys compatible with any or all of the Linux PGP-based encryption products? Also, how do I import my own keys, especially the private key? I have one program installed: gpg (GnuPG) 1.4.16, and it would be convenient to use this one, but I'm open to others. I think that I imported my public key into ~/.gnupg/pubring.gpg, but I can't figure out how to get GnuPG to use or prompt me for my private key, and when I type ...
$ gpg filename
... I get the error message: "gpg: decryption failed: secret key not available".
Any suggestions would be appreciated.
Tom
 
Old 10-30-2015, 08:57 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
We moved from pgp on HP-UX Unix to gpg on RHEL Linux back in 2013.

All you need to do is copy your public and private keyrings from the user(s) on your old system to the equivalent user(s) on your new system. You can then use "gpg --import <keyring_file>" to import the keyrings.

e.g.
To import private (secret) keyring file:
gpg --import secring.skr

To import public keyring file:
gpg --import pubring.pkr

NB: As noted above the keyrings are stored and imported for specific users rather than globally. If you want to import the keyring to user, billybob, you'd want to "su - billybob" before running the import. Obviously the copied in keyring file has be owned by the user you're doing the import as. (You should NOT have global permissions on keyring files for obvious reasons.)

Note that the syntax for gpg encryption, signing and decryption is slightly different than pgp.

You might also consider planning on updating your keys with whatever 3rd parties you've given your public keys to as 10 year old keys likely use lesser cypher strength than newer ones but you can do that after the imports by simply creating new keys and providing those to whoever has your old keys.

Edit: On reread I see you apparently did import your public keyring. You also need to import your secret keyring.

Last edited by MensaWater; 10-30-2015 at 08:59 AM.
 
Old 10-30-2015, 09:23 AM   #3
thomas.hedden
Member
 
Registered: May 2006
Location: Carlisle, MA
Distribution: Ubuntu, Fedora
Posts: 60

Original Poster
Rep: Reputation: 16
Hello Mensa Water,
Thank you for your reply. I still can't import the private key.
Public key appears OK:
horse[tom]: /home/tom/.gnupg$ gpg --list-keys
/home/tom/.gnupg/pubring.gpg
----------------------------
pub 1024D/0273F576 2005-01-05
uid Thomas Hedden <my@email.address.zzz>
sub 2048g/604B3AE2 2005-01-05

horse[tom]: /home/tom/.gnupg$ gpg --import secring.skr
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

What I did is to type my private key into a file
that I gave the right name to, then executed the
command that you suggested.

I suspect that the problem has to do with the format
of the file secring.skr, however I don't know what
the correct format is. That is, the public key has
the following structure:
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: PGP 8.1
[characters of public key ]
-----END PGP PUBLIC KEY BLOCK-----
The private key file that I am using just has the key,
not "BEGIN" or "END" lines. Do you (or anyone else)
know whether there is a structure for the private key
file, and if so, what it is?
Thanks in advance for any help.
Tom
 
Old 10-30-2015, 10:05 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
For a private key I generated I see the multiple lines of the private key encapsulated like this:

Code:
-----BEGIN PGP PRIVATE KEY BLOCK-----
Version: GnuPG v1.4.5 (GNU/Linux)

lSO9SSpSqUBCACZW1PSS5BjbI5Wub+RrzvfISBnBDV9RpM/kWnSC4oSlvCSSw2A
<multiple similar lines>
yvS7lE49Gup04rSStP/DeSK0hwxOTskRqwbYP3y24F13SS/W6u6Rp6/SSw/T/rPu
ik5gSSp0SS6Z
=uoH0
-----END PGP PRIVATE KEY BLOCK-----
If I run "file" against that individually stored key file it shows it as an ASCII file.

If I run "file" against my original pgp keyring file it displays as: PGP key security ring
The format of the keyring file is different than the above.

You can import an individual ASCII secret key into your key ring with:
gpg --import ./<sec_key_ascii_file>
 
  


Reply

Tags
gnupg, gpg, import, pgp, private key



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
OpenPgp secret keys Blaktyger Linux - Software 4 02-06-2015 03:51 PM
[SOLVED] Linux and openpgp keys and signatures MBA Whore Linux - Security 8 10-04-2014 12:25 PM
Import and export keys, PGP to GnuPG imchi Linux - Software 3 10-11-2011 11:50 AM
gnupg pgp kmail bong.mau Linux - Security 0 05-03-2006 02:00 PM
PGP or GNUPG SkYzOpReNiCk Linux - Software 1 02-28-2001 04:49 PM

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

All times are GMT -5. The time now is 02:56 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