Saturday, January 29, 2011

GPG encrypt and decrypt with ssh-agent

I use ssh regularly and have ssh-agent set up.

How can I use ssh keys to gpg-encrypt a file?

Edit: It seems that this is impossible. Why? ssh can encrypt traffic, so why not also files?

  • No, SSH keys are not PGP keys and serve different purpose .
    You must have PGP keys in GnuPG keyring.
    But - you can convert GPG keys to PGP keys (using gpgkey2ssh) and gpg-agent can take care of ssh keys (using --enable-ssh option). I believe no such tool exists for converting SSH keys to GPG keys and cannot exist.

    nalply : I prefer to work in the reverse: use gpg with ssh keys, since I already have an extensive ssh infrastructure.
    Kristaps : that is not possible. Just view size of SSH public key and GPG public key -> SSH key contains much less info.
    nalply : Okay, some things are not possible with SSH keys but I believe that encryption **is possible** since ssh encrypts traffic. Perhaps I should have asked: How can I encrypt a file with an SSH key?
    From Kristaps

0 comments:

Post a Comment