keybase / keybase-issues

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

Decrypting secret key from bundle #3039

Open johnkuszmaul opened 7 years ago

johnkuszmaul commented 7 years ago

Hello,

I would like to access my secret key without exporting it from my profile or using the Keybase command line tool.

When I login and view user.private_keys.primary.bundle, there is a string which is Base64(MessagePack(some stuff + TripleSec(my private key))). [1]

I believe I have partially reduced this down to TripleSec(my private key), where it is a string beginning with 1c94d7de000…

How do I decrypt this? I installed the python command line tool [2] and ran triplesec -k < mypassword > dec 1c94d7de000… but I get ERROR: Failed authentication of the data. This happens when I provide the wrong key for decryption.

Is the the key that was used to encrypt my private key with TripleSec not my Keybase password?

Thanks, John

[1] TripleSec - https://keybase.io/triplesec [2] Python command Tool - https://github.com/keybase/python-triplesec#user-content-command-line-tool

maxtaco commented 7 years ago

You probably need the salt from the server too. It's a random string, different for every user.

johnkuszmaul commented 7 years ago

Thanks for the response. I looked into it further and I believe the problem was something else -- it seems the python tool and the way Keybase does Triplesec work differently, or I am using it wrong.

When I used the “In-Browser Magical Demo” here https://keybase.io/triplesec, my encrypted secret key (1c94d7de000…) was successfully decrypted(into a string with unreadable characters) when I put my Keybase password as the decryption key. However, the Python tool does not successfully decrypt it.

Likewise, when I encrypt a message with the “in-browser magical demo” I cannot then decrypt it with the Python tool, or vice-versa. Am I using the Python tool incorrectly? If I cannot use the Python tool to decrypt the secret key I’ll try using other languages.

Thanks, John