33

I have a 3072 bit RSA key that I generated for use with SSH. Can this key-pair be used with PGP/GPG, or do I need to generate a new pair of keys separately for use in email encryption?

Are the two interchangeable, or is there a difference between the two?

4
  • 5
    Even if they were, it's generally a bad idea to re-use the same key across multiple contexts. Aug 31, 2014 at 3:51
  • 1
    Both PGP and SSH support RSA public/private key pairs, so presumably it is possible.
    – lzam
    Aug 31, 2014 at 15:18
  • 1
    @StephenTouset would you elaborate why this is not a good idea in this case?
    – schatten
    Sep 18, 2015 at 1:48
  • See also this answer for why not to use the same key for signing and encryption. The reasoning about key management extends to SSH authentication too.
    – 0 _
    Jul 31, 2016 at 0:44

1 Answer 1

27

Yes, the same RSA key pair can be used for both (Open)SSL and OpenPGP/GnuPG.

The monkeysphere project contains a tool to convert RSA keys in PEM format to the one defined by OpenPGP, pem2openpgp. For converting the SSH key pair into the PEM format, there already is a comprehensive answer in Converting keys between openssl and openssh.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .