{"id":28456171,"url":"https://github.com/pdoup/encdec","last_synced_at":"2025-06-27T02:32:12.511Z","repository":{"id":294725478,"uuid":"987878793","full_name":"pdoup/EncDec","owner":"pdoup","description":"A tool to securely encrypt and decrypt folder contents with filename obfuscation and concurrency","archived":false,"fork":false,"pushed_at":"2025-05-22T12:08:45.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-06T22:41:31.867Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/pdoup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-21T18:12:12.000Z","updated_at":"2025-05-22T12:12:42.000Z","dependencies_parsed_at":"2025-05-21T19:39:10.648Z","dependency_job_id":"f35775d1-0aba-445b-8839-6e074ded0f36","html_url":"https://github.com/pdoup/EncDec","commit_stats":null,"previous_names":["pdoup/encdec"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pdoup/EncDec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdoup%2FEncDec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdoup%2FEncDec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdoup%2FEncDec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdoup%2FEncDec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pdoup","download_url":"https://codeload.github.com/pdoup/EncDec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdoup%2FEncDec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262177768,"owners_count":23270931,"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","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":[],"created_at":"2025-06-06T22:40:26.238Z","updated_at":"2025-06-27T02:32:12.503Z","avatar_url":"https://github.com/pdoup.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Folder Encryptor/Decryptor Tool\n\nA command-line utility for encrypting and decrypting the contents of entire folders.\n\n## :warning: **EXTREME CAUTION ADVISED** :warning:\n\n* **DESTRUCTIVE NATURE**: This tool directly modifies your files and filenames. Incorrect use, bugs, interruptions, or loss of the encryption key **WILL LEAD TO IRREVERSIBLE DATA LOSS.**\n* **HANDLE WITH EXTREME CARE**: Especially when dealing with sensitive or important data.\n* **ALWAYS BACKUP YOUR DATA**: Before using this tool on any important files, ensure you have a separate, verified backup.\n* **KEY MANAGEMENT IS CRITICAL**: Losing your `secret.key` file means your encrypted data will be **PERMANENTLY UNRECOVERABLE**. Secure your key file diligently.\n* **TEST THOROUGHLY**: Use on non-critical data first to understand its behavior and ensure it works as expected in your environment.\n\n**USE AT YOUR OWN RISK. THE AUTHORS ARE NOT RESPONSIBLE FOR ANY DATA LOSS.**\n\n## Features\n\n* **Strong Encryption**: Uses Fernet (AES-128 in CBC mode with PKCS7 padding) for file content.\n* **Filename Obfuscation**: Encrypted files are renamed to their SHA-256 hashes.\n* **Integrity Checks**: HMAC-SHA256 for key file and filename mapping integrity.\n* **Concurrency**: Utilizes multithreading for faster processing of multiple files.\n* **Backup Option**: Can create backups of files before encryption/decryption.\n* **Restore Mode**: Attempt to restore files from backups in case of errors during encryption.\n* **Customizable**:\n    * Exclude files by extension.\n    * Filter files/folders by size.\n    * Adjustable number of worker threads.\n\n## Core Operations\n\n1.  **Encryption**:\n    * Generates a `secret.key` (if one doesn't exist for encryption).\n    * Optionally backs up original files to a `.bak` directory.\n    * Renames original files to a hash of their original name.\n    * Encrypts the content of these renamed files.\n    * Creates an encrypted `filenames.map` to track original names.\n2.  **Decryption**:\n    * Requires the correct `secret.key`.\n    * Reads the encrypted `filenames.map`.\n    * Optionally backs up encrypted files.\n    * Decrypts file content.\n    * Restores original filenames.\n    * Optionally cleans up backup files and the map.\n\n## Installation\n\n### Local Build\n\nInside the root project folder, run:\n\n```bash\npython -m build -w\n```\n\nThe command generates a `.whl` file in the `dist/` directory.\n\nInstall the wheel with:\n```bash\npip install dist/generated_file.whl # replace with actual .whl filename\n```\n\n### Run program without installation\n\nThe `folder-encryptor` can also run as a standalone application without building via `run.py` script:\n```bash\npython run.py target_dir/ encrypt # e.g., to encrypt target_dir\n```\n\n## Basic Usage\n\n```bash\n# Encrypt a folder\nfolder-encryptor \"/path/to/your/folder\" encrypt --key \"my_secret.key\"\n\n# Decrypt a folder\nfolder-encryptor \"/path/to/your/folder\" decrypt --key \"my_secret.key\"\n\n# View all options\nfolder-encryptor --help\n```\n```txt\n# Output\nusage: FolderEncryptor [-h] [--key KEY] [--exclude EXCLUDE] [--no-purge-after-decrypt] [--no-backup] [--min-folder-size SIZE]\n                       [--max-file-size SIZE] [--workers WORKERS] [-q] [--restore-from-backup] [-v]\n                       folder {encrypt,decrypt}\n\nSecurely encrypts or decrypts a folders contents.\n\npositional arguments:\n  folder                    Target folder for encryption or decryption.\n  {encrypt,decrypt}         Operation mode.\n\noptions:\n  -h, --help                show this help message and exit\n  --key KEY                 Path to the key file (default: secret.key).\n  --exclude EXCLUDE         Comma-separated file extensions to exclude (e.g., .log,.tmp). Case-insensitive.\n  --no-purge-after-decrypt  If set, keeps backup folders and map files after successful decryption.\n  --no-backup               If set, disables creation of backups before modifying files. RISKY.\n  --min-folder-size SIZE    Min total size of a subfolder for processing (e.g., 10MB). Encryption only.\n  --max-file-size SIZE      Skip individual files larger than this size (e.g., 100MB). Encryption only.\n  --workers WORKERS         Number of worker threads (default: 2).\n  -q, --quiet               Suppress console output (logs are still written to file).\n  --restore-from-backup     Special mode: attempts to restore the target folder from existing backups.\n  -v, --version             show program's version number and exit\n```\n\n\n## Dependencies\n\n```bash\ncachetools\ncryptography\n```\n\nAlso, `setuptools`, `wheel` and `build` are required for building the package.\n\n## Disclaimer\n\nThis tool is provided \"as-is\" without any warranty. Always ensure you understand the risks before using it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdoup%2Fencdec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdoup%2Fencdec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdoup%2Fencdec/lists"}