{"id":30349700,"url":"https://github.com/john0isaac/protect-my-dir","last_synced_at":"2026-02-26T05:59:57.792Z","repository":{"id":290274926,"uuid":"973887143","full_name":"john0isaac/protect-my-dir","owner":"john0isaac","description":"A command-line tool designed to encrypt and decrypt files within a directory using a password.","archived":false,"fork":false,"pushed_at":"2025-04-28T00:28:33.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-11T02:49:54.004Z","etag":null,"topics":["encryption","python","security"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/protect-my-dir/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/john0isaac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"john0isaac","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":null}},"created_at":"2025-04-27T23:50:14.000Z","updated_at":"2025-04-29T14:19:00.000Z","dependencies_parsed_at":"2025-04-28T00:32:13.383Z","dependency_job_id":"59b679e2-2298-4066-95b1-66a0b5aa2897","html_url":"https://github.com/john0isaac/protect-my-dir","commit_stats":null,"previous_names":["john0isaac/protect-my-dir"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/john0isaac/protect-my-dir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john0isaac%2Fprotect-my-dir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john0isaac%2Fprotect-my-dir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john0isaac%2Fprotect-my-dir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john0isaac%2Fprotect-my-dir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/john0isaac","download_url":"https://codeload.github.com/john0isaac/protect-my-dir/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/john0isaac%2Fprotect-my-dir/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271053844,"owners_count":24691198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["encryption","python","security"],"created_at":"2025-08-18T20:08:41.614Z","updated_at":"2026-02-26T05:59:52.771Z","avatar_url":"https://github.com/john0isaac.png","language":"Python","funding_links":["https://github.com/sponsors/john0isaac"],"categories":[],"sub_categories":[],"readme":"# Protect My Dir\n\nA command-line tool designed to encrypt and decrypt files within a directory using a password. It provides a simple and secure way to protect sensitive files using AES encryption.\n\n## Features\n\n- **AES Encryption**: Uses AES (Advanced Encryption Standard) in CBC (Cipher Block Chaining) mode with PKCS7 padding for secure encryption.\n- **Password-Based Key Derivation**: Utilizes PBKDF2 with SHA256 for deriving encryption keys from passwords, ensuring strong security.\n- **Salt and IV Generation**: Automatically generates a unique salt and initialization vector (IV) for each file to enhance security.\n- **File Encryption**: Encrypts individual files and removes the original unencrypted files.\n- **File Decryption**: Decrypts previously encrypted files and restores them to their original state.\n- **Directory Support**: Recursively encrypts or decrypts all files in a specified directory.\n- **Error Handling**: Provides meaningful error messages for incorrect passwords or corrupted files.\n- **Cross-Platform**: Works on any platform that supports Python.\n\n## Installation\n\n1. Clone the repository:\n\n   ```bash\n    git clone https://github.com/john0isaac/protect-my-dir.git\n    cd protect-my-dir\n    ```\n\n2. Create a virtual environment and Install the required dependencies using [uv](https://docs.astral.sh/uv/):\n\n    ```bash\n    uv sync\n    ```\n\n## Usage\n\nThe tool provides a CLI interface for encrypting and decrypting directories. Below are the available commands and options:\n\n- Encrypt a Directory:\n\n    To encrypt all files in a directory:\n\n    ```bash\n    protect-my-dir --directory /path/to/directory --encrypt\n    ```\n\n    You will be prompted to enter a password. The tool will encrypt all files in the directory and remove the original files.\n\n- Decrypt a Directory:\n\n    To decrypt all files in a directory:\n\n    ```bash\n    protect-my-dir --directory /path/to/directory --decrypt\n    ```\n\n    You will be prompted to enter the password used for encryption. The tool will decrypt all files in the directory and restore them to their original state.\n\nCommand-line options:\n\n- `--directory` or `-dir`: Specify the directory containing files to encrypt or decrypt.\n- `--encrypt` or `-e`: Encrypt the files in the specified directory.\n- `--decrypt` or `-d`: Decrypts all `.enc` files in the specified directory.\n\n## How It Works\n\n1. Encryption:\n\n    - A unique salt and IV are generated for each file.\n    - The password is used to derive a 256-bit encryption key using PBKDF2.\n    - The file is padded, encrypted, and saved with a `.enc` extension.\n    - The original file is securely deleted.\n\n1. Decryption:\n\n    - The salt and IV are extracted from the encrypted file.\n    - The password is used to derive the decryption key.\n    - The file is decrypted, unpadded, and restored to its original state.\n    - The encrypted file is securely deleted.\n\n## Security Considerations\n\n- **Password Strength**: Use a strong, unique password to ensure the security of your files.\n- **Backup**: Always keep a backup of your password. If you lose it, the files cannot be decrypted.\n- **File Removal**: The tool deletes original files after encryption and encrypted files after decryption. Ensure you have backups if needed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohn0isaac%2Fprotect-my-dir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohn0isaac%2Fprotect-my-dir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohn0isaac%2Fprotect-my-dir/lists"}