News for hackers. Stuff that matters.
Re:Storing sensitive data in a git repository using git-crypt by agwa on Tuesday April 01, 2014 @08:03PM (#7512667)
Yes, I believe git-crypt is secure for that use case (as long as you keep your git-crypt key secure, of course). Although I'm not a professional cryptographer, I've taken Coursera's crypto course, have read Cryptography Engineering, and keep myself informed of the various pitfalls and attacks on crypto.

On the theory side, git-crypt uses AES in CTR mode with a nonce derived from the HMAC of the file. This is provably secure against an attack model called deterministic chosen-plaintext attack. In this regard, git-crypt is more secure than many similar projects (such as git-encrypt), which use AES in ECB mode or CBC mode with a fixed IV. These systems leak information and are not secure against deterministic chosen-plaintext attacks.

On the implementation side, git-crypt uses OpenSSL's crypto functions and the crypto code is extremely simple - pretty much a textbook example of how to properly do AES in CTR mode.

If anyone's curious, here's the code where AES-CTR is implemented: https://github.com/AGWA/git-crypt/blob/master/crypto.cpp#L76

And here is where it calculates the nonce (and also checks to make sure the counter value won't be overflowed): https://github.com/AGWA/git-crypt/blob/master/commands.cpp#L...

There are no comments on this comment yet.