keybase / keybase-issues

A single repo for managing publicly recognized issues with the keybase client, installer, and website.
902 stars 37 forks source link

How to export private key from keybase with API or kbpgp.js? #1912

Closed lettergram closed 8 years ago

lettergram commented 8 years ago

I have the desire to access my private key stored in keybase. However, when I login and view: user.private_keys, there doesn't appear that a private key stored the same way as user.public_keys.

When I view: user.private_keys.primary.bundle there does appear to be a string that could be a private key, but I don't know how to format it into a usable pirvate_key. It looks like the string is either encrypted or encoded differently than normal.

Basically, you can export your public key from keybase, is that functionality available in the API, or some other method I don't know about?

oconnor663 commented 8 years ago

The string you're seeing is Base64(MessagePack(some stuff + TripleSec(your private key))). You could decrypt it, but it will be inconvenient. You probably want to export your private key with this little menu:

image

malgorithms commented 8 years ago

If you're running the Go client of Keybase ( keybase.io/download ) this also works:

keybase pgp export --secret

That'll decrypt + export your PGP secret key, which you can pipe into gpg or a file or whatever you want.

leonardishere commented 6 years ago

The string you're seeing is Base64(MessagePack(some stuff + TripleSec(your private key))). You could decrypt it, but it will be inconvenient.

Assuming I have a situation that requires I do it in code, how would I do that? I already have the login code and can retrieve my user object that has the bundled private key, how do I unbundle it?