sops icon indicating copy to clipboard operation
sops copied to clipboard

Adding support for ssh keys for encryption.

Open Mic92 opened this issue 5 years ago • 8 comments

SSH keys could be also used for encryption. They are already in well-known locations i.e. /etc/ssh/ssh_host_rsa_key. Most developer/servers have already ssh keys. Since most users also have ways of trusting those ssh keys (TOFU, DNS, hosters like github/gitlab or certificates) importing them should be easy. For my project I am thinking about converting ssh keys to gpg keys. However it would be probably also beneficial for sops itself to have this supported out-of-the box. I think usability of ssh-keygen over gpg is out of question.

Mic92 avatar Jul 09 '20 00:07 Mic92

Here is some boilercode to convert ssh keys to gpg: https://gist.github.com/Mic92/24c40996cd97cb8edd53fd688c60ab6f

Mic92 avatar Jul 09 '20 09:07 Mic92

I agree with the initial request of using SSH keys for encryption, and #688 will give us that because age supports ssh keys.

The PGP key storage format is an abomination and it would be a mistake to add more complexity. Ultimately, we need to steer people away from PGP entirely.

jvehent avatar Jul 09 '20 13:07 jvehent

@jvehent unfortunately, #688 missing ssh keys supports

gzm55 avatar Sep 29 '20 03:09 gzm55

I will built a tool eventually to convert ed25519 as well to age keys, like I did for gpg.

Mic92 avatar Oct 04 '20 09:10 Mic92

Bump?

D3vl0per avatar Jun 20 '22 18:06 D3vl0per

I have built: https://github.com/Mic92/ssh-to-age https://github.com/Mic92/ssh-to-pgp/ for use with sops. ssh-to-age can be used for ed25519 keys and ssh-to-pgp for rsa-based ssh keys.

Mic92 avatar Jun 21 '22 05:06 Mic92

@Mic92 does your implementation literaly the same as https://github.com/FiloSottile/age/blob/main/agessh/agessh.go#L190 << https://blog.filippo.io/using-ed25519-keys-for-encryption age internally does on providing an ssh-ed25519 wrapping it into a X25519 curve encoded as Bech32 with HRP AGE-SECRET-KEY-?! looks like you copied some code and redistributed it under MIT without copyleft while age provided it under BSD 🤔

childnode avatar Jan 16 '24 10:01 childnode

BSD and MIT are compatible with each other.

Mic92 avatar Jan 16 '24 11:01 Mic92