RepoPilotOpen in app →

AGWA/git-crypt

Transparent file encryption in git

Mixed

Slowing — last commit 8mo ago

worst of 4 axes
Use as dependencyConcerns

copyleft license (GPL-3.0) — review compatibility; top contributor handles 90% of recent commits…

Fork & modifyHealthy

Has a license, tests, and CI — clean foundation to fork and modify.

Learn fromHealthy

Documented and popular — useful reference codebase to read through.

Deploy as-isHealthy

No critical CVEs, sane security posture — runnable as-is.

  • Last commit 8mo ago
  • 10 active contributors
  • GPL-3.0 licensed
Show 5 more →
  • CI configured
  • Slowing — last commit 8mo ago
  • Single-maintainer risk — top contributor 90% of recent commits
  • GPL-3.0 is copyleft — check downstream compatibility
  • No test directory detected
What would change the summary?
  • Use as dependency ConcernsMixed if: relicense under MIT/Apache-2.0 (rare for established libs)

Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests

Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.

Embed the "Forkable" badge

Paste into your README — live-updates from the latest cached analysis.

Variant:
RepoPilot: Forkable
[![RepoPilot: Forkable](https://repopilot.app/api/badge/agwa/git-crypt?axis=fork)](https://repopilot.app/r/agwa/git-crypt)

Paste at the top of your README.md — renders inline like a shields.io badge.

Preview social card (1200×630)

This card auto-renders when someone shares https://repopilot.app/r/agwa/git-crypt on X, Slack, or LinkedIn.

Onboarding doc

Onboarding: AGWA/git-crypt

Generated by RepoPilot · 2026-05-09 · Source

🤖Agent protocol

If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:

  1. Verify the contract. Run the bash script in Verify before trusting below. If any check returns FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding.
  2. Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
  3. Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/AGWA/git-crypt shows verifiable citations alongside every claim.

If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.

🎯Verdict

WAIT — Slowing — last commit 8mo ago

  • Last commit 8mo ago
  • 10 active contributors
  • GPL-3.0 licensed
  • CI configured
  • ⚠ Slowing — last commit 8mo ago
  • ⚠ Single-maintainer risk — top contributor 90% of recent commits
  • ⚠ GPL-3.0 is copyleft — check downstream compatibility
  • ⚠ No test directory detected

<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>

Verify before trusting

This artifact was generated by RepoPilot at a point in time. Before an agent acts on it, the checks below confirm that the live AGWA/git-crypt repo on your machine still matches what RepoPilot saw. If any fail, the artifact is stale — regenerate it at repopilot.app/r/AGWA/git-crypt.

What it runs against: a local clone of AGWA/git-crypt — the script inspects git remote, the LICENSE file, file paths in the working tree, and git log. Read-only; no mutations.

| # | What we check | Why it matters | |---|---|---| | 1 | You're in AGWA/git-crypt | Confirms the artifact applies here, not a fork | | 2 | License is still GPL-3.0 | Catches relicense before you depend on it | | 3 | Default branch master exists | Catches branch renames | | 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code | | 5 | Last commit ≤ 257 days ago | Catches sudden abandonment since generation |

<details> <summary><b>Run all checks</b> — paste this script from inside your clone of <code>AGWA/git-crypt</code></summary>
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of AGWA/git-crypt. If you don't
# have one yet, run these first:
#
#   git clone https://github.com/AGWA/git-crypt.git
#   cd git-crypt
#
# Then paste this script. Every check is read-only — no mutations.

set +e
fail=0
ok()   { echo "ok:   $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }

# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
  echo "FAIL: not inside a git repository. cd into your clone of AGWA/git-crypt and re-run."
  exit 2
fi

# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "AGWA/git-crypt(\\.git)?\\b" \\
  && ok "origin remote is AGWA/git-crypt" \\
  || miss "origin remote is not AGWA/git-crypt (artifact may be from a fork)"

# 2. License matches what RepoPilot saw
(grep -qiE "^(GPL-3\\.0)" LICENSE 2>/dev/null \\
   || grep -qiE "\"license\"\\s*:\\s*\"GPL-3\\.0\"" package.json 2>/dev/null) \\
  && ok "license is GPL-3.0" \\
  || miss "license drift — was GPL-3.0 at generation time"

# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
  && ok "default branch master exists" \\
  || miss "default branch master no longer exists"

# 4. Critical files exist
test -f "git-crypt.cpp" \\
  && ok "git-crypt.cpp" \\
  || miss "missing critical file: git-crypt.cpp"
test -f "commands.cpp" \\
  && ok "commands.cpp" \\
  || miss "missing critical file: commands.cpp"
test -f "crypto.hpp" \\
  && ok "crypto.hpp" \\
  || miss "missing critical file: crypto.hpp"
test -f "coprocess.hpp" \\
  && ok "coprocess.hpp" \\
  || miss "missing critical file: coprocess.hpp"
test -f ".gitattributes" \\
  && ok ".gitattributes" \\
  || miss "missing critical file: .gitattributes"

# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 257 ]; then
  ok "last commit was $days_since_last days ago (artifact saw ~227d)"
else
  miss "last commit was $days_since_last days ago — artifact may be stale"
fi

echo
if [ "$fail" -eq 0 ]; then
  echo "artifact verified (0 failures) — safe to trust"
else
  echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/AGWA/git-crypt"
  exit 1
fi

Each check prints ok: or FAIL:. The script exits non-zero if anything failed, so it composes cleanly into agent loops (./verify.sh || regenerate-and-retry).

</details>

TL;DR

git-crypt is a C++ tool that provides transparent encryption/decryption of files in Git repositories using OpenSSL, GPG, or symmetric keys. It lets developers store encrypted secrets (API keys, passwords, certificates) alongside code without locking down the entire repository—files matching .gitattributes patterns are encrypted on commit and decrypted on checkout, while users without the key can still clone and work with unencrypted files. Monolithic C++ codebase with core encryption logic in crypto.cpp/.hpp, command dispatch in commands.cpp/.hpp, and platform abstractions for Unix (coprocess-unix.cpp, util-unix.cpp) and Windows (coprocess-win32.cpp, util-win32.cpp). GPG integration in gpg.cpp/.hpp handles key sharing; the .git-crypt directory stores encrypted keys per-user.

👥Who it's for

DevOps engineers, security-conscious developers, and teams that need to share repositories containing sensitive credentials without using separate secret vaults. Contributors are individuals building infrastructure tools or enhancing cryptographic workflows in Git.

🌱Maturity & risk

Actively developed and production-ready at v0.8.0 (released 2025-09-23), with CI/CD pipelines for Linux ARM64, Linux x86, and Windows in .github/workflows/. However, the project explicitly states it has not reached v1.0 maturity—documentation and feature completeness are still being improved, and breaking changes may occur before stabilization.

Single-maintainer risk (Andrew Ayer): the repo structure shows no clear team. OpenSSL dependency may require maintenance as OpenSSL versions evolve (crypto-openssl-11.cpp suggests past version-specific handling). Platform-specific code (coprocess-unix.cpp, coprocess-win32.cpp, util-win32.cpp) increases maintenance surface. No visible test suite in the file list, which is concerning for cryptographic software.

Active areas of work

GitHub Actions workflows are set up for releasing binaries across Linux ARM64, Linux x86, and Windows. The repository appears to be in maintenance mode with incremental improvements; the latest release (0.8.0, Sept 2025) suggests ongoing but measured development.

🚀Get running

Clone the repository, run make to build (Makefile at root), and optionally make install. See INSTALL.md for detailed platform-specific build instructions. No npm/pip; pure C++ with Make-based build system.

Daily commands: Build with make, then initialize a repo with git-crypt init, configure .gitattributes with filter=git-crypt rules, unlock with git-crypt unlock (GPG or symmetric key), and use Git normally—encryption/decryption happens via Git filter/diff attributes. See README.md for examples.

🗺️Map of the codebase

  • git-crypt.cpp — Main entry point and command dispatcher; all CLI interactions flow through here.
  • commands.cpp — Implements core git-crypt commands (init, lock, unlock, add-keyphrase); essential for understanding feature logic.
  • crypto.hpp — Cryptographic abstraction layer defining encryption/decryption interface; critical to security model.
  • coprocess.hpp — Inter-process communication with git filter driver; load-bearing for transparent encryption workflow.
  • .gitattributes — Declares which files use git-crypt filters; configuration that enables the entire feature.
  • key.cpp — Key management and loading logic; handles secret material security.
  • gpg.cpp — GPG integration for key encryption and sharing; critical for multi-user scenarios.

🛠️How to make changes

Add a new git-crypt command

  1. Define the command handler signature in commands.hpp (commands.hpp)
  2. Implement the command logic in commands.cpp (commands.cpp)
  3. Register the command in the git-crypt.cpp main dispatch switch (git-crypt.cpp)
  4. Update the man page documentation (man/git-crypt.xml)

Support a new platform or crypto backend

  1. If platform-specific, add util-[platform].cpp alongside util.cpp and util.hpp (util.hpp)
  2. If crypto backend, add crypto-[backend].cpp with OpenSSL abstraction pattern (crypto.hpp)
  3. If coprocess needs platform changes, add coprocess-[platform].cpp (coprocess.hpp)
  4. Update Makefile with conditional compilation flags (Makefile)

Extend key management (e.g., new key storage backend)

  1. Extend the key class or create key_storage abstraction in key.hpp (key.hpp)
  2. Implement new key loading/storing logic in key.cpp (key.cpp)
  3. Wire new backend into gpg.cpp if GPG integration needed (gpg.cpp)
  4. Update commands.cpp (e.g., 'init' command) to use new backend (commands.cpp)

Add multi-repository or CI/CD integration feature

  1. Add new command function in commands.cpp following existing pattern (commands.cpp)
  2. Register command in git-crypt.cpp dispatcher (git-crypt.cpp)
  3. Document in README.md and/or doc/ folder (README.md)

🔧Why these technologies

  • OpenSSL (libcrypto) — Provides AES-256-CTR encryption, widely available, audited cryptography library; abstracted via crypto.hpp for flexibility
  • Git filter driver protocol (clean/smudge) — Standard git mechanism for transparent file transformation; enables encryption without modifying git core logic
  • GPG integration — Allows users to encrypt the git-crypt key file with GPG, enabling secure multi-user key sharing without storing plaintext secrets
  • C++ with POSIX/Win32 platform abstraction — Performance-critical crypto operations; platform abstraction (coprocess-unix.cpp, util-unix.cpp, etc.) enables cross-OS support

⚖️Trade-offs already made

  • Transparent encryption via git filter driver rather than application-level encryption

    • Why: Reduces developer friction; encryption/decryption happens automatically during git operations
    • Consequence: Files in working tree are plaintext (security depends on OS file permissions and memory safety); not suitable for air-gapped deployments
  • Symmetric AES-256 key (not asymmetric PKI) as core encryption primitive

    • Why: Simpler key management, faster encryption, avoids key distribution complexity
    • Consequence: All users sharing a repository must trust each other with the symmetric key; no per-user audit trail
  • GPG-encrypted key file (optional) rather than built-in key derivation

    • Why: Leverages existing GPG trust infrastructure; users already have GPG keys
    • Consequence: GPG becomes a dependency for multi-user scenarios; adds subprocess overhead
  • Coprocess abstraction for filter communication vs. spawning git filter repeatedly

    • Why: Single long-lived filter process for performance; amortizes subprocess startup overhead
    • Consequence: Increased memory footprint; filter process state must be carefully managed

🚫Non-goals (don't propose these)

  • Per-file or per-user access control; git-crypt is all-or-nothing with a shared symmetric key
  • Encrypted git metadata (commit messages, branch names, author info); only file content is encrypted
  • Key rotation or versioning; rotating a key requires re-encrypting all files
  • Real-time decryption of large files during clone; decryption happens on checkout (blocking operation)
  • Integration with cloud key management services (KMS); uses local filesystem + optional GPG

🪤Traps & gotchas

GPG must be installed and configured for add-gpg-user and unlock commands to work; symmetric key unlock requires a pre-shared key file conveyed securely offline. OpenSSL library must be available (linked at build time); version mismatches between crypto-openssl-11.cpp and system OpenSSL can cause silent failures. .gitattributes filter rules must be committed before adding sensitive files, or those files won't be encrypted on first commit. Windows users need careful handling of path separators in key files and .git-crypt directory setup.

🏗️Architecture

💡Concepts to learn

  • Git Filter Attributes — git-crypt's core mechanism: .gitattributes filter=git-crypt directive triggers encryption on add/commit and decryption on checkout; understanding how Git invokes external filters is essential
  • AES-256-CBC Encryption — git-crypt uses AES-256 in CBC mode (via OpenSSL) for file encryption; knowing block cipher modes, IVs, and padding is crucial for understanding crypto.cpp
  • PBKDF2 Key Derivation — git-crypt derives symmetric keys from passphrases using PBKDF2; this is how unlock passwords become usable encryption keys
  • GPG (GNU Privacy Guard) Integration — add-gpg-user command wraps the symmetric key with each collaborator's public GPG key; requires understanding GPG's key model and subprocess communication
  • File Handle Streams (fhstream) — git-crypt implements custom C++ stream classes (fhstream.cpp) that encrypt/decrypt data in-flight; understanding stream abstractions and buffering is needed to modify I/O paths
  • Unix Coprocess Communication — coprocess-unix.cpp manages bidirectional pipes to GPG subprocess; fork(), dup2(), and pipe() are used to orchestrate secure IPC without exposing keys to the command line
  • Windows Process Creation (CreateProcess API) — coprocess-win32.cpp uses Windows CreateProcess, pipe handles, and inheritance flags; necessary for debugging or extending GPG integration on Windows
  • EJBCA/ejbca — Enterprise PKI/certificate management; shares GPG and cryptographic key handling concerns
  • mozilla/sops — Encrypts YAML/JSON secrets in version control; direct alternative for secret storage in repos
  • hashicorp/vault — Centralized secret management; complements git-crypt for teams wanting external secret storage instead of in-repo encryption
  • git/git — Core Git repository; git-crypt extends Git via the filter/diff attributes mechanism, so understanding Git's hook system is essential
  • openssl/openssl — Dependency for AES encryption; crypto-openssl-11.cpp directly binds to this library's EVP API

🪄PR ideas

To work on one of these in Claude Code or Cursor, paste: Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.

Add comprehensive unit tests for cryptographic operations in crypto.cpp

The repo has crypto.cpp and crypto-openssl-11.cpp handling encryption/decryption but no visible test suite. Given this is a security-critical tool, adding unit tests would validate encryption correctness, key handling, and edge cases. This is essential for maintaining trust in the codebase and catching regressions.

  • [ ] Create a test directory with CMake or Makefile integration
  • [ ] Write tests for key generation and loading (key.cpp)
  • [ ] Write tests for encryption/decryption roundtrips (crypto.cpp)
  • [ ] Write tests for GPG key integration (gpg.cpp)
  • [ ] Integrate test execution into the existing CI workflows (.github/workflows)

Add GitHub Actions workflow for macOS builds and testing

The repo has release workflows for Linux ARM64, Linux x86, and Windows (.github/workflows/) but is missing macOS CI. This is a gap since git-crypt is cross-platform and macOS is a common developer platform. A macOS workflow would catch platform-specific issues early.

  • [ ] Create .github/workflows/release-macos.yml based on existing Linux/Windows workflows
  • [ ] Add macOS-specific build steps using homebrew for dependencies
  • [ ] Test both Intel and ARM64 (Apple Silicon) architectures
  • [ ] Ensure GPG and OpenSSL dependencies are properly resolved for macOS
  • [ ] Validate man page generation works on macOS

Document multi-key management workflow with practical examples in doc/

doc/multiple_keys.md exists but the README snippet shows the usage documentation is incomplete (cuts off at 'g'). Adding a comprehensive guide with examples would help users understand the key rotation, sharing, and revocation workflows. This addresses a complex feature that likely has support questions.

  • [ ] Complete and expand doc/multiple_keys.md with step-by-step examples
  • [ ] Document how to rotate keys without re-encrypting all files
  • [ ] Add examples for sharing encrypted repos with team members with different keys
  • [ ] Document key removal and revocation procedures
  • [ ] Add troubleshooting section for common multi-key scenarios

🌿Good first issues

  • Add comprehensive unit tests for crypto.cpp and key.cpp encryption/decryption round-trips; currently no test files visible in the repo, which is critical for a cryptographic tool.
  • Expand INSTALL.md with step-by-step build instructions for ARM64 Linux (tests pass in CI but desktop docs lack ARM-specific flags); check .github/workflows/release-linux-arm64.yml for build matrix details.
  • Document the .gitattributes pattern syntax and common pitfalls in a dedicated doc/gitattributes.md file, as the README only provides examples and doesn't explain globbing behavior or interaction with .gitignore.

Top contributors

Click to expand

📝Recent commits

Click to expand
  • 8c7a90f — Update URL for docbook.xsl (russellshackleford)
  • 1f1f5e4 — Upgrade GitHub Actions (AGWA)
  • 567aec5 — Improve formatting of NEWS.md (AGWA)
  • dd1b1f4 — Remove plaintext README and NEWS files (AGWA)
  • 2322f61 — GitHub Actions: use older version of Ubuntu for better compatibility (AGWA)
  • 669eae3 — Build linux-arm64 binaries (AGWA)
  • 247da93 — GitHub Actions: explicitly specify Ubuntu version (AGWA)
  • 6ca139c — GitHub Actions: fix Windows build (AGWA)
  • 1d3055d — Remove unneeded include (AGWA)
  • 160cf64 — Prepare 0.8.0 release (AGWA)

🔒Security observations

git-crypt is a mature open-source encryption tool with reasonable security practices, but several concerns exist: (1) Potential memory safety issues inherent to C++ require careful code review; (2) Use of deprecated OpenSSL 1.1 is a significant risk that must be addressed; (3) Platform-specific code requires thorough

  • Medium · Potential Buffer Overflow in C++ Code — commands.cpp, crypto.cpp, util.cpp, coprocess-unix.cpp, coprocess-win32.cpp, fhstream.cpp. The codebase contains multiple C++ files (commands.cpp, crypto.cpp, util.cpp, coprocess-unix.cpp, coprocess-win32.cpp) that handle cryptographic operations and file I/O. C++ is prone to buffer overflow vulnerabilities if string operations and memory management are not carefully implemented. Given this is a security-critical application dealing with encryption keys, any memory safety issues could compromise the entire system. Fix: Conduct a thorough code review focusing on: (1) Use of safe string functions instead of strcpy, strcat, sprintf; (2) Bounds checking on all array and buffer operations; (3) Consider using modern C++ containers (std::string, std::vector) instead of raw C-style arrays; (4) Enable compiler warnings (-Wall -Wextra) and address all issues; (5) Consider using AddressSanitizer (ASan) and MemorySanitizer during development and testing
  • Medium · Cryptographic Implementation Risk — crypto-openssl-11.cpp, crypto.cpp, crypto.hpp. The presence of both 'crypto-openssl-11.cpp' and 'crypto.cpp' suggests there may be multiple or transitional cryptographic implementations. OpenSSL 1.1 is deprecated and no longer receives security updates as of September 2023. Using outdated cryptographic libraries poses a significant risk for security-critical applications. Fix: Verify that the project: (1) Migrates to OpenSSL 3.x or newer; (2) Removes legacy OpenSSL 1.1 support; (3) Uses cryptographic functions correctly (e.g., proper key derivation, authenticated encryption modes); (4) Validates that all cipher modes provide both confidentiality and authenticity (e.g., AES-GCM); (5) Implements proper random number generation for keys and IVs using CSPRNG sources
  • Medium · Platform-Specific Code Execution Risk — coprocess-unix.cpp, coprocess-win32.cpp, util-unix.cpp, util-win32.cpp. The codebase includes platform-specific implementations for Unix (coprocess-unix.cpp, util-unix.cpp) and Windows (coprocess-win32.cpp, util-win32.cpp). These files likely contain system calls and inter-process communication mechanisms that could be vulnerable to privilege escalation, command injection, or process hijacking attacks if not properly validated. Fix: Review all system calls for: (1) Proper input validation before passing arguments to system functions; (2) Use of secure APIs (e.g., execve with explicit argument arrays instead of shell interpretation); (3) Proper handling of environment variables to prevent injection; (4) Correct permission and umask settings; (5) Test on both Unix/Linux and Windows platforms with security testing tools
  • Low · GPG Integration Security Considerations — gpg.cpp, gpg.hpp. The presence of gpg.cpp and gpg.hpp indicates integration with GPG for key management. This external dependency introduces complexity and potential attack vectors if not properly implemented, such as man-in-the-middle attacks on GPG operations or insecure key material handling. Fix: Ensure: (1) GPG operations are executed securely with proper verification of GPG signatures; (2) Key material is never logged or exposed in error messages; (3) GPG subprocess is spawned securely without shell interpretation; (4) Output from GPG is properly parsed without assuming specific formats; (5) Document GPG version requirements and compatibility
  • Low · Missing Security Documentation — Repository root. While the repository includes CONTRIBUTING.md, there is no visible SECURITY.md file for responsible disclosure of vulnerabilities. This makes it difficult for security researchers to report issues responsibly. Fix: Create a SECURITY.md file that includes: (1) Instructions for responsible vulnerability disclosure; (2) Contact information for security issues; (3) PGP key for encrypted communication; (4) Timeline expectations for patches; (5) Information about which versions are actively supported

LLM-derived; treat as a starting point, not a security audit.


Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.

Mixed signals · AGWA/git-crypt — RepoPilot