Skip to content

trustedsec/obfusgit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

obfusgit - Dual-Repo Obfuscation System

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.

Quick Start

Setup (one-time per project)

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

Daily Workflow

  1. Make changes to your source files (plaintext)
  2. Commit normally: git commit -m "Your message"
  3. The pre-commit hook automatically:
    • Encrypts all tracked files
    • Commits to the public repo with obfuscated content
    • Pushes to the remote (if configured)

Commands

setup-repos

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)

sync

Manually sync files from private to public repo:

python3 obfusgit.py sync --config .obfusgit/config.json

commit-all

Commit to both repos (for manual workflow):

python3 obfusgit.py commit-all --privateRepo /path/to/repo [--config .obfusgit/config.json]

reverse-repos - Import from Encrypted Repo

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 ReversedRepo

This 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 content

Configuration

The .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 obfuscate
  • files.exclude - Glob patterns to exclude from obfuscation
  • public_repo_path - Path to the encrypted repo directory

How It Works

  1. Encryption: Files are encrypted with RC4, base64 encoded, then mapped to English words
  2. Sync: On commit, files are automatically copied to .obfusgit-public/ with encrypted content
  3. Decryption: Use decrypt command or reverse-repos to recover original content

Manual Encryption/Decryption

# 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.txt

Post-commit Hook

The post-commit hook (/.git/hooks/post-commit) automatically runs sync after each commit, ensuring your public repo is always up-to-date.

On initial commit after reverse-repos

git -c custom.ignorePostCommitHook=yes commit -m "Initial Commit"

Pushing to Public Repo

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

Security Notes

  • 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

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages