GithubHelp home page GithubHelp logo

mic92 / ssh-to-pgp Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 4.0 86 KB

Convert SSH RSA keys to GPG keys

License: MIT License

Go 60.50% Nix 25.28% Shell 14.22%
build-with-buildbot managed-by-renovate

ssh-to-pgp's Introduction

ssh-to-pgp

Convert SSH RSA keys to GPG keys

Usage

  • Exports the private:
$ ssh-to-pgp -private-key -i $HOME/.ssh/id_rsa -o private-key.asc
2504791468b153b8a3963cc97ba53d1919c5dfd4
  • Exports the public key:
$ ssh-to-pgp -i $HOME/.ssh/id_rsa -o public-key.asc
2504791468b153b8a3963cc97ba53d1919c5dfd4

Install with nix

$ nix-shell -p 'import (fetchTarball "https://github.com/Mic92/ssh-to-pgp/archive/main.tar.gz") {}'

Install with go

$ go get github.com/Mic92/ssh-to-pgp

ssh-to-pgp's People

Contributors

bors[bot] avatar dependabot[bot] avatar ettom avatar mergify[bot] avatar mic92 avatar mic92-renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ssh-to-pgp's Issues

Output is Broken Again

It seems the Problem has reappeared in Version 1.1.3

          hopefully we no longer have this issue because we switched away from this fork of the crypto library: https://github.com/Mic92/ssh-to-pgp/blob/main/go.mod

Originally posted by @Mic92 in #12 (comment)

Invalid key generated

I think I found a bug, introduced in ff31dcb.

Output before that commit:

./ssh-to-pgp -i test-assets/id_rsa
-----BEGIN PGP PUBLIC KEY BLOCK-----

xsDNBAAAAAABDADSeS6SEputIOi2mQhLeIEJnMAink+KcUv38HnaLak3nnLmUsYJ
nXYB5KZGxaxVtIjr59J8TndmwniZ+wc0rql6Dkif9CsTXgAjxrPiknZNQ7JQbgWU
r0pk4jx/K3zLD6i/XAS8QWySNJmY5aJWySbF/K687kUMJ5ql0BX4Tt0RiWL4pIwz
ZZlLzH4rRySy4z1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OCK-----

xsDNBAAAAAABDADSeS6SEputIOi2mQhLeIEJnMAink+KcUv38HnaLak3nnLmUsYJ
nXYB5KZGxaxVtIjr59J8TndmwniZ+wc0rql6Dkif9CsTXgAjxrPiknZNQ7JQbgWU
r0pk4jx/K3zLD6i/XAS8QWySNJmY5aJWySbF/K687kUMJ5ql0BX4Tt0RiWL4pIwz
ZZlLzH4rRySy4z1kbiuOZf8htVRtlGoDGqGViJRpuybSKrmXbevRI7aWjiml2BVT
MktPekAPx+MA3t/8EM/uJxtWp7g3BsneHQdKIjR0WEKAITTmuDLEEtIXXEUbgBW0
WjbD62nRft/A6/iyWykPJmkLA4WnSLS03caeUxCKoEthZ1xfBPCRNw7xbysQF8CH
Jz8cAMjZGgBGlOin8EKDhmlma6FZ94cAB5Tr4G3R0h4ky77bPk2/6vvZtyU/AFnD
P2HfGaRCDNF+Q7+fR9YmKwcW/vCa2ItIEXgMmBjS+yl0p+4fVaY6Q7bCTbrd6znb
6gTGo7nD9Kj/CGUAEQEAAc0pcm9vdCAoSW1wb3J0ZWQgZnJvbSBTU0gpIDxyb290
QGxvY2FsaG9zdD4=
=uf61
-----END PGP PUBLIC KEY BLOCK-----82ddc034d5ded2524f701114d96f6e894818c7a5

Importing the latter key with gpg fails:

82ddc034d5ded2524f701114d96f6e894818c7a5
gpg: key 0xD96F6E894818C7A5: no valid user IDs
gpg: this may be caused by a missing self-signature
gpg: Total number processed: 1
gpg:           w/o user IDs: 1

Support configuring the user id

Hi, this is a feature request to support configuration of the fields hardcoded here:

uid := packet.NewUserId("root", "Imported from SSH", "root@localhost")

The main idea is that, when managing multiple keys from different hosts, it's difficult to tell which key belongs to which host at a glance. For my use case it would be sufficient if localhost would default to the hostname of the current machine, but perhaps allowing some/all fields to be specified via command line arguments would be more extensible.

Any way to stop creating AEAD pgp certs from ssh at all please?

Hi

I wasn't sure if its here or in my gpg settings, but the pgp key created with ssh-to-pgp on newer versions of gpg include a seemingly non standard AEAD support.

Pass for android app uses PGPainless backend, which does not and will not support AEAD, as far as I understand it.

I wondered if it is possible to specify to create compatible pgp keys excluding AEAD?

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.