Giter Club home page Giter Club logo

git-encrypt's People

Contributors

shadowhand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

git-encrypt's Issues

Gitcrypt not working with GitX

MacOS 10.9, GitX 0.14.95.

I cloned a remote repo, and configured gitcrypt in this local repo. In shell it works well. But when I open this repo in a GUI Git client, such as my GitX, click any commit, will got this error:

gitcrypt smudge: gitcrypt: command not found
error: external filter gitcrypt smudge failed -1
error: external filter gitcrypt smudge failed
gitcrypt diff: gitcrypt: command not found
fatal: unable to read files to diff

My gitcrypt is located in ~/bin, is there anything special that i must config in GitX?

Q: Appropriate uses: public repo?

Sorry if this is an inappropriate forum or a stupid question but:

Let's say I have a completely public git repo, say on github. But I've got a file of passwords that can not be public. If I use git-encrypt to encrypt to that file, is this within the intended use cases of git-encrypt, is this something that makes sense to do? Or is it a bad idea?

Thanks for any advice,

Fix poor cryptography defaults

I have several major criticisms with respect to the cryptography choices made in this project.

First, ECB mode is a bad idea. It should very literally never be used for any serious application of cryptography.

In a nutshell, ECB mode provides no semantic security. Patterns present in the plaintext will still be present in the ciphertext. The data itself may be obfuscated, but its relationship to other data is left intact. As with the case of the Tux image in that link, one can often use this property to reconstruct the original data from the encrypted data.

Second, there is zero reason to have users provide their own salt (or even for your tool to do so behind the scenes). The salt in this case is only used for key derivation, and OpenSSL is more than capable of generating its own high-quality, random salts. The only possible result from allowing users to provide their own is to decrease the likeliness of a unique salt from being used. Infinitely more so when your own documentation specifies a phenomenally negligent default like 0x0000000000000000 (it should be noted that specifying any value that could be interpreted as a "default" is negligent, but a value like that even more so).

More worryingly, some of the problems of using ECB mode are actually compounded by using a fixed salt like this. If you simply allowed OpenSSL to generate its own salts, random salts would be used during key derivation for new encryptions, causing each encryption to be performed with a unique key. This doesn't provide semantic security for data within a single git blob, but at least it provides for semantic security for data in separate ones.

If these choices were made because git is incapable of working correctly when using a sane encryption mechanism like AES in CBC or CTR mode (CTR mode is preferred, but not implemented on outdated but somewhat recent versions of OpenSSL) and/or properly-derived keys, then I'm afraid this project is likely fundamentally broken from a cryptography perspective, offering security which, while not quite on the kid sister part of the spectrum, is much closer to it than you probably realize.

`init` fails with openssl 1.1.0

Using the latest version of gitcrypt (legacy branch).
I have a repo which already has gitcrypte'd files which I have cloned to another machine.
When I use gitcrypt init I enter the salt and password but choosing the cipher fails.

gitcrypt init   
<SNIP>
What encryption cipher do you want to use? [aes-256-ecb] 
Invalid command 'list-cipher-commands'; type "help" for a list.
Error: Cipher 'aes-256-ecb' is not available

Invalid command 'list-cipher-commands'; type "help" for a list. is the error and this seems to be coming from openssl at this line.

  • OpenSSL 1.1.0g 2 Nov 2017
  • gitcrypt (legacy branch)
  • Ubuntu 18.04.1 LTS

git-encrypt on Windows

Is it important or not if I don't use the function encrypt diff in the script gitcrypt. I know it will generate the ugly difference bettween 2 version of the same file. But apart of this issue, does it influence anything else about the version history of the repository?
Because for me, "encrypt diff" seem do not work on windows. when I run "git diff filename" with encrypt I have this error
cat: $@: No such file or directory
cat: $@: No such file or directory

Thanks in advance for your answer.

Check encryption before push

Hi,

is there a way to check that my file is realy encrypted before I push it to a remote repo?

Regards
Dieter

git-crypt path ubuntu vs osx

Hello, I'm working with Vagrant/ansible setup to do development and I've notice a small incompatibility that might be simple to fix.

When ever I do a git checkout of my project within the Ubuntu box I run git-crypt unlock on the repository. Since the virtual box directory is exposed to the osx host machine I am able work on the repository as if it is a project installed on OSX (shared directories). Apparently the git-crypt unlock stores the complete (ubuntu) path to git-crypt in the repository. This then fails on osx as the path to git-crypt is different.

on osx i get these results;

$ git-crypt --version
git-crypt 0.5.0
$ which git-crypt
/usr/local/bin/git-crypt
$ git-crypt unlock git-crypt-key.key  
$ grep -R git-crypt ./.git/
./.git//config:[filter "git-crypt"]
./.git//config: smudge = \"git-crypt\" smudge
./.git//config: clean = \"git-crypt\" clean
./.git//config:[diff "git-crypt"]
./.git//config: textconv = \"git-crypt\" diff

from ubuntu I get these results;

$ which git-crypt
/usr/bin/git-crypt
$ git-crypt --version
git-crypt 0.5.0
$ git-crypt unlock git-crypt-key.key  
$ grep -R git-crypt ./.git/
./.git/config:[filter "git-crypt"]
./.git/config:  smudge = \"/usr/bin/git-crypt\" smudge
./.git/config:  clean = \"/usr/bin/git-crypt\" clean
./.git/config:[diff "git-crypt"]
./.git/config:  textconv = \"/usr/bin/git-crypt\" diff

As you can see both git-crypt versions store a reference to the git-crypt executable differently which will be problematic in the described - admittedly not so mainstream - setup.

I'm aware that I can simply run git-crypt unlock from the host machine as a work around but I'm wondering if there is a better way to work around this.

So, is this something that can be fixed or configured?

Problems with hidden(dot) files

Gitcrypt has problems with dot files.

If i have this in .gitattributes:

.ssh/id_rsa filter=encrypt diff=encrypt
.ssh/authorized_hosts filter=encrypt diff=encrypt

it just doesn't work and i have no idea why?

New Release?

Any chance of getting a new release sometime soon? I could really use the submodule support that's in the develop branch, and would like to avoid forking and uploading my own copy to npm if possible.

Feature - gitcrypt commands

I think adding a couple of "setup" commands would be quite useful, just as a shortcut to manually editing .gitattributes and or .gitconfig. As an example - https://github.com/nvie/gitflow does this quite nicely

gitcrypt init:
It could ask for/set up the salt and passphrase, then add them to git config and also map the encrypt filter.

gitcrypt add:
add the pattern format to the encryption filter

gitcrypt remove:
remove the pattern format from the encryption filter

gitcrypt (0.3.0, 0.3.1, 0.3.2) did not work with git v2.2.x

I checked with the following git versions:

git v1.9.5: ok
git v2.0.0: ok
git v2.0.5: ok
git v2.1.4: ok

git v2.2.0, v2.2.1, v2.2.2: NOT ok

I checked with git-encrypt v0.3.0, v0.3.1 and v0.3.2, the problem was the same.

Steps to reproduce:

vagrant@vagrant:~/workspace/personal$ git --version
git version 2.2.0
vagrant@vagrant:~/workspace/personal$ gitcrypt version
gitcrypt version 0.3.0
vagrant@vagrant:~/workspace/personal$ mkdir test
vagrant@vagrant:~/workspace/personal$ cd test/
vagrant@vagrant:~/workspace/personal/test$ git init
Initialized empty Git repository in /home/vagrant/workspace/personal/test/.git/
vagrant@vagrant:~/workspace/personal/test$ touch README.md
vagrant@vagrant:~/workspace/personal/test$ gitcrypt init
Generate a random salt? [Y/n] 
Generate a random password? [Y/n]n
Enter your passphrase: 123456
What encryption cipher do you want to use? [aes-256-ecb] 

This configuration will be stored:

salt:   1f144788937c915a
pass:   123456
cipher: aes-256-ecb

Does this look right? [Y/n] 
Do you want to use .git/info/attributes? [Y/n] n
What files do you want encrypted? [*] 
vagrant@vagrant:~/workspace/personal/test$ git status
On branch master

Initial commit

Untracked files:
  (use "git add <file>..." to include in what will be committed)

    .gitattributes
    README.md

nothing added to commit but untracked files present (use "git add" to track)
vagrant@vagrant:~/workspace/personal/test$ git add .
error: copy-fd: read returned Bad file descriptor
error: cannot feed the input to external filter gitcrypt clean
error: external filter gitcrypt clean failed

as we could see, when I $ git add, we got the following messages:

error: copy-fd: read returned Bad file descriptor
error: cannot feed the input to external filter gitcrypt clean
error: external filter gitcrypt clean failed

So before a fix for this is updated, we will need to use the working git versions tested above.

For anyone stuck with an encrypted file and git-encrypt not working anymore

To decrypt e.g. a file foobar.secret:

$ cd your-repo
$ cat .git/config
…
[gitcrypt]
        salt = 0ddba11c0ffee
        pass = "tooquoof8ahK)uozie]xu7naebah5aa3"
        cipher = aes-256-ecb
…
$ pass="tooquoof8ahK)uozie]xu7naebah5aa3"
$ cipher=aes-256-ecb
$ openssl enc -d -base64 -$cipher -k "$pass" < foobar.secret > foobar.decrypted

hope that helps.
😃

Is it possible to use git-encrypt on a submodule?

I have an unencrypted root project that has an encrypted submodule.

Adding the gitcrypt info to the root/.git/config does not cause the submodule to decrypt.
Additionally there is no .git folder in /root/submodule that I can add information to.

Do you have any insight? thanks

New release please

Could I request that you put in a new release tag. I'm submitting git-encrypt as a homebrew formula but there's a request that I not create the formula from HEAD, but rather a stable point. Given the last pull requests I think a new release tag would be worthwhile.

(Homebrew/legacy-homebrew#11608)

Thanks much

Totally NOT an issue

Just wanted to say how awesome this little project is. Thanks so much for making it!!

Encrypting existing commits

If I start using git-encrypt on an existing repo, it will only encrypt going forward. Is there a good way to go back and encrypt the existing commits, ideally while maintaining commit date, commit message, etc? I'm think of using something like git filter-branch, but I wonder if someone has already figured out a good way to do this.

create new download tag from develop branch

Would you please create a new download tag from the current develop branch? The current version isn't fully compatible with Mac OS X and I'd like to update the homebrew version of git-encrypt, but it's not possible without a stable version.

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.