21

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?

  • 5
    Even if they were, it's generally a bad idea to re-use the same key across multiple contexts. – Stephen Touset Aug 31 '14 at 3:51
  • 1
    Both PGP and SSH support RSA public/private key pairs, so presumably it is possible. – lzam Aug 31 '14 at 15:18
  • 1
    @StephenTouset would you elaborate why this is not a good idea in this case? – schatten Sep 18 '15 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. – Ioannis Filippidis Jul 31 '16 at 0:44
18

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.