Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have someone's ssh public key and I want to encrypt a message with it so that he is the only one who can read it. However, a simple import with gpg --import doesn't work because the format is different.

How can I convert the public key (in the format as they appear in authorized_keys) to a format that gpg can import?

share|improve this question
possible duplicate of Are GPG and SSH keys interchangable? – Claudio Floreani Sep 16 '15 at 9:26

The two keys each serve a different purpose, and as a result are not interchangeable.

Specifically, SSH keys are basic asymmetric key pairs, much of the values that PGP keys require, are not present in SSH.

You could substitute the missing certificate value by self-signing the SSH key, but this seems flakey, and cannot guarantee it will import into GPG.

Best to obtain a generated GPG key from this person.

share|improve this answer

You must log in to answer this question.

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