Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-crypt unlock doesn't decrypt file #60

Closed
doender opened this issue Aug 17, 2015 · 9 comments
Closed

git-crypt unlock doesn't decrypt file #60

doender opened this issue Aug 17, 2015 · 9 comments

Comments

@doender
Copy link

doender commented Aug 17, 2015

We have added 2 gpg's by doing:
git-crypt add-gpg-user USER_ID

Decrypting works for the first user, but when he pushes it and I pull and run git-crypt unlock, I get prompted for the passphrase (MacOS, GPG Suite):

You need a passphrase to unlock the secret key for
user: ...
4096-bit RSA key, ID ..., created 2015-08-17 (main key ID ...)

The program then finishes (no error message) but the file is still encrypted.

@AGWA
Copy link
Owner

AGWA commented Aug 17, 2015 via email

@doender
Copy link
Author

doender commented Aug 18, 2015

I can enter my passphrase (and it seems to accept it, because I get an error message when I enter a wrong passphrase). However, it then just finishes and doesn't decrypt the encrypted files.

@AGWA
Copy link
Owner

AGWA commented Aug 18, 2015 via email

@doender
Copy link
Author

doender commented Aug 18, 2015

I saw I was using an older version of git-crypt (0.4.0). Since I've
upgraded to 0.5.0 everything works fine!

Op di 18 aug. 2015 om 16:41 schreef Andrew Ayer notifications@github.com:

First, could you try removing the file with rm and then checking it out
with git checkout? If that successfully decrypts the file, please let me
know which version of Git you're using since there may have been a breaking
change in Git.

If that doesn't decrypt the file, could you send me the output of git check-attr -a FILENAME (replacing FILENAME with the name of the file) and
openssl dgst -sha256 .git/git-crypt/keys/default. Please run these
commands from the top of both the first user's repository and your
repository (after running git-crypt unlock).


Reply to this email directly or view it on GitHub
#60 (comment).

@AGWA AGWA closed this as completed Aug 18, 2015
@ghost
Copy link

ghost commented Mar 2, 2017

For posterity, I had a case where a git-crypt enabled file was moved, and the literal encrypted body of the file got committed (I think), so I had a case where git-crypt was succeeding to decrypt the file, but the file was still encrypted. It might be worthwhile to disallow this kind of nested encryption.

@nolith
Copy link

nolith commented May 8, 2017

same here double encryption at work :(

@Deracination
Copy link

This may be related to GPG not knowing which tty to use to prompt for the passphrase.

I had the same issue and followed the suggestion here: https://superuser.com/a/778586

export GPG_TTY=$(tty)

gpg then prompted for the passphrase as expected and files were unlocked.

@RonquilloAeon
Copy link

@Deracination you saved me! I was getting a git-crypt: GPG error: Failed to decrypt error. Turns out that my terminal window was too small for gpg to show the prompt. I made the window larger and all was good.

@codygman
Copy link

codygman commented Mar 1, 2021

I'm getting this error as well with git-crypt 0.6.0 and wonder if it could be related to having a ed25519 gpg key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants