Encrypt files using RC4, base64 encode, then map sequences to English words. Features automatic dual-repo synchronization where your private repo keeps plaintext and a hidden public repo stores encrypted versions.
cd /path/to/your/repo
git init # if not already a git repo
python3 obfusgit.py setup-repos --privateRepo .This creates:
.obfusgit/config.json- Configuration file with encryption key.obfusgit-public/- Hidden git repo for encrypted files
- Make changes to your source files (plaintext)
- Commit normally:
git commit -m "Your message" - The pre-commit hook automatically:
- Encrypts all tracked files
- Commits to the public repo with obfuscated content
- Pushes to the remote (if configured)
Initialize dual-repo obfuscation:
python3 obfusgit.py setup-repos --privateRepo /path/to/repo [--encryptionKey your_key]Options:
--privateRepo- Path to private repository (required)--encryptionKey- Encryption key for RC4 (auto-generated if not specified)
Manually sync files from private to public repo:
python3 obfusgit.py sync --config .obfusgit/config.jsonCommit to both repos (for manual workflow):
python3 obfusgit.py commit-all --privateRepo /path/to/repo [--config .obfusgit/config.json]Clone an existing encrypted repo and set up your local environment:
# Clone the encrypted repository
git clone <encrypted_repo_url> project
cd project
# Set up local repos with your encryption key
python3 obfusgit.py reverse-repos --publicRepo /path/to/cloned/repo/
--encryptionKey "your_encryption_key_here" --privateRepoName ReversedRepoThis creates:
ReversedRepo/- Your private development repo with plaintext files in the same directory as cloned.obfusgit-public/- Copy of the public repo cloned down that gets synced to.obfusgit/config.json- Configuration for automatic sync
Now work normally in the private repo:
cd ReversedRepo
# Edit files as normal
git commit -m "Your changes" # Auto-syncs to public repo with obfuscated contentThe .obfusgit/config.json file:
{
"encryption_key": "your_encryption_key_here",
"files": {
"include": ["**/*"],
"exclude": [".obfusgit/**", ".git/**"]
},
"public_repo_path": ".obfusgit-public"
}encryption_key- RC4 encryption key (store securely!)files.include- Glob patterns for files to obfuscatefiles.exclude- Glob patterns to exclude from obfuscationpublic_repo_path- Path to the encrypted repo directory
- Encryption: Files are encrypted with RC4, base64 encoded, then mapped to English words
- Sync: On commit, files are automatically copied to
.obfusgit-public/with encrypted content - Decryption: Use
decryptcommand orreverse-reposto recover original content
# Encrypt
python3 obfusgit.py encrypt --inputKey "key" --sourceFile file.txt --destFile encrypted.obfus
# Decrypt
python3 obfusgit.py decrypt --inputKey "key" --sourceFile encrypted.obfus --destFile decrypted.txtThe post-commit hook (/.git/hooks/post-commit) automatically runs sync after each commit, ensuring your public repo is always up-to-date.
git -c custom.ignorePostCommitHook=yes commit -m "Initial Commit"
To actually push the obfuscated public repo you need to add an remote server to the ".obfusgit-public" folder.
cd .obfusgit-public
git remote add origin <location>
git push origin master
- The encryption key is stored in
.obfusgit/config.json- keep this file secure - Use strong, unique keys for each repository
- The pre-commit hook runs automatically - be aware of what gets synced to the public repo