4 ms·
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,
by agwa 13y ago
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 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#L82 https://github.com/AGWA/git-crypt/blob/master/commands.cpp#L...