keybase / keybase-issues

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

"You need a passphrase to unlock the secret key" #1214

Open pikajude opened 9 years ago

pikajude commented 9 years ago

Having just joined keybase and encrypted my first test message:

$ keybase encrypt -m "This is a secret message" joelteon > message
$ keybase decrypt message -o message.txt

You need a passphrase to unlock the secret key for
user: "keybase.io/joelteon <joelteon@keybase.io>"
2048-bit RSA key, ID 5C168495C8328D1E, created 2014-11-04
         (subkey on main key ID 4FB87AFD575DFF5D)

warn: [GNUPG:] ENC_TO 5C168495C8328D1E 1 0
warn: [GNUPG:] USERID_HINT 5C168495C8328D1E keybase.io/joelteon <joelteon@keybase.io>
warn: [GNUPG:] NEED_PASSPHRASE 5C168495C8328D1E 4FB87AFD575DFF5D 1 0
warn: gpg: cancelled by user
warn: [GNUPG:] MISSING_PASSPHRASE
warn: gpg: encrypted with 2048-bit RSA key, ID 5C168495C8328D1E, created 2014-11-04
warn:       "keybase.io/joelteon <joelteon@keybase.io>"
warn: gpg: public key decryption failed: Operation cancelled
warn: [GNUPG:] ERROR pkdecrypt_failed 99
warn: [GNUPG:] BEGIN_DECRYPTION
warn: [GNUPG:] DECRYPTION_FAILED
warn: gpg: decryption failed: No secret key
warn: [GNUPG:] END_DECRYPTION
error: `gpg` exited with code 2
pathawks commented 9 years ago

You cancelled decryption?

pikajude commented 9 years ago

How would I have done that?

danieldavidson commented 9 years ago

The only way I can reproduce this error is after executing keybase decrypt ..., manually closing the dialog that asks for my passphrase. Entering my passphrase into the dialog decrypts the message properly.

pikajude commented 9 years ago

Where is the dialog supposed to show up?

danieldavidson commented 9 years ago

Instead of

$ keybase encrypt -m "This is a secret message" joelteon > message
$ keybase decrypt message -o message.txt

try executing

$ keybase encrypt -m "This is a secret message" joelteon -o message
$ keybase decrypt message -o message.txt

What happens?

pikajude commented 9 years ago

Same as in the original post.

Something has changed after the original post (I don't know what). After it prints this:

You need a passphrase to unlock the secret key for
user: "keybase.io/joelteon <joelteon@keybase.io>"
2048-bit RSA key, ID 5C168495C8328D1E, created 2014-11-04
         (subkey on main key ID 4FB87AFD575DFF5D)

keybase hangs instead of telling me that I cancelled the decryption. This happens if I use either > message or -o message.

pathawks commented 9 years ago

What OS are you running? Have you previously installed any GPG tools?

pikajude commented 9 years ago

OSX. I have pinentry and all the gnupg2 executables in PATH, though I don't know what effect that will have.

carwash commented 9 years ago

I have what I think is the same problem, also on OS X with pinentry: when running keybase encrypt or keybase prove, keybase will tell me "You need a passphrase to unlock the secret key for user: …" but will not then provide a prompt to enter the passphrase, instead hanging. (Using gpg directly prints the same message, but the prompt appears as expected and everything works.)

JustinTArthur commented 9 years ago

Keybase is currently incompatible with gpg2 due to the weird console dialog it employs. There is a workaround described in #110 that looks like this:

GPG_TTY=`tty` keybase decrypt message -o message.txt
arkadiyt commented 9 years ago

+1 also ran into this, and

GPG_TTY=`tty`

fixed it for me

Videl commented 9 years ago

Had an issue about this too, @arkadiyt's solution worked.

I'm on Linux Mint 17 'Qiana', 64-bit.

sschaefer commented 8 years ago

I had these symptoms, and GPG_TTY=$(tty) did not fix it for me.

Solution: gnome-keyring-daemon had started up when my laptop was connected to one DHCP server/subnet, but then later it switched to a different DHCP server/subnet. gnome-keyring-daemon had apparently memorized the former laptop IP address which was no longer available, and couldn't connect to the X11 server. Workaround: I logged out and back in, to get a clued-in gnome-keyring-daemon process.

rrasouli commented 8 years ago

I have had similar issue: I worked remotely on a VM which I copied the gpg key there I was connected via vncviewer, I couldn't commit and sign with gpg. Solution was: connect the VM via console, the gpg passphrase appeared then, after entering the passpharse on console screen, the sign with -S succeeded and it never asked for a passphrase

camponez commented 8 years ago

Ubuntu 16.04. I'm having this issue.

$ GPG_TTY=tty keybase decrypt message -o message.txt warn: [GNUPG:] ENC_TO C40D7FAD56A57304 1 0 warn: [GNUPG:] PINENTRY_LAUNCHED 12674 warn: gpg: encrypted with 4096-bit RSA key, ID XXXXXXXXXXXXXXX, created 2014-01-17 warn: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" warn: gpg: public key decryption failed: Operation cancelled warn: [GNUPG:] ERROR pkdecrypt_failed 83886179 warn: [GNUPG:] BEGIN_DECRYPTION warn: [GNUPG:] DECRYPTION_FAILED warn: gpg: decryption failed: No secret key warn: [GNUPG:] END_DECRYPTION error: gpg exited with code 2

Fixed:

I had to add allow-loopback-pinentry to my ~/.gnupg/gpg-agent.conf and restart gpg-agent (kill-all gpg-agent)

ghost commented 6 years ago

Using Mail app and GPG Keychain on macOS with Pinentry Mac and after 5 months of use suddenly I start seeing this dialog takeover my repeatedly screen (with focus).

screen shot 2017-12-28 at 1 53 20 pm

The funny part is the above dialog won't accept the password I recorded for the account 5 months ago. Dialog won't even tell me if password is valid or not after entry and pressing return. It just keeps popping up and disrupting me while Mail is open. Thankfully I paid for Protonmail and use the Protonmail Bridge now which has worked well so far.

screen shot 2017-12-28 at 2 04 09 pm
maxtaco commented 6 years ago

@jhabdas this likely has nothing to do with Keybase