Replies: 6 comments 7 replies
-
|
Oh, I should probably mention that I'm aware of agebox, but AFAICS it doesn't really work with git but rather in parallel with it. |
Beta Was this translation helpful? Give feedback.
-
|
Your problem is most likely with your age file encryption is not deterministic. I'm guessing however that You either need to figure out how to massage the filter APIs to support non-deterministic / non-invertible transformations (e.g. re-decrypt the old version in |
Beta Was this translation helpful? Give feedback.
-
|
Hey, just stumbled upon this. I'm currently building something I'm calling (as working title) git-age that tries to solve this problem. I only started last week so it's more of a PoC than a production ready CLI so far - I'm not satisfied yet with the test coverage 🙈 but it kinda works so give it a try and let me know if you're missing anything (besides more docs 😂 I'm unfortunately aware but I'm trying). With a bit of luck I'll be able to provide you with a release and pre-compiled binaries some time next week. @FiloSottile any feelings about the name? Shall I change it to avoid the impression it's tight to age itself? |
Beta Was this translation helpful? Give feedback.
-
|
We also have an application that uses clean/smudge filters to encrypt files: https://github.com/uw-labs/strongbox We have been using it for 7y+ but was initially written using SIV encryption. Recently added |
Beta Was this translation helpful? Give feedback.
-
|
This is the fundamental tension: age is designed to be non-deterministic (which is the right default for encryption), but git filters require mdenc explicitly chose the other side of this tradeoff — deterministic encryption where the nonce is derived from HMAC-SHA256 of the content. Same plaintext + same key = identical ciphertext, so git filters work cleanly. No phantom diffs, no need for hash-comparison workarounds like the SOPS-inspired approach discussed above. The cost is real: it leaks whether content changed between commits, paragraph count, sizes, and repeated content. This is documented in the security model. It's designed for internal team docs in public repos, not high-value secrets. It encrypts Markdown at paragraph granularity, so diffs are meaningful even on the encrypted side. Spec covers the full construction. |
Beta Was this translation helpful? Give feedback.
-
|
fwiw I completely moved off the idea of encrypting / decrypting via git filters. in practice it was just a half baked hassle. using agenix and completely encrypted files in the worktree. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm having some troubles with using
ageas a filter in git. I sent a question to the Git User list but thought I might have more luck here. It can be summarised asThe config of the filter works as intended, but
git diffbelieves that filtered file is modified in a brand new clone.What follows now is the text I posted to the Git User list, but with some markdown to make it nicer.
I'm trying out age as a filter for encrypting files in a git repo but I must be missing something because every new clone thinks the encrypted file has changed, and if I commit that change then every other clone sees a diff after pulling in the change.
The main reason I want to try out age is that it can make use of SSH keys for encryption, which makes it a bit nicer than something like git-crypt.
I'm setting it up like this:
Here's a sequence setting up a first repo:
Now I can make a clone:
So far so good. The file is encrypted. Now I configure the filter the same way
and make sure the file is decrypted:
Now comes the problem, git thinks the file with secrets has been changed when it
really hasn't:
This isn't what I expected. What's wrong with my setup, what am I missing?
Beta Was this translation helpful? Give feedback.
All reactions