{"id":18563583,"url":"https://github.com/ishanoshada/encodify","last_synced_at":"2025-04-10T03:32:50.072Z","repository":{"id":202998679,"uuid":"708542791","full_name":"Ishanoshada/Encodify","owner":"Ishanoshada","description":"Python Code Encoding Module","archived":false,"fork":false,"pushed_at":"2023-11-25T05:24:04.000Z","size":36,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T16:03:36.758Z","etag":null,"topics":["encode","encodify","marshal","python-encode","python-encryption","python-marshal","python-obfuscate"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/encodify","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/Ishanoshada.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}},"created_at":"2023-10-22T21:20:34.000Z","updated_at":"2024-06-17T20:40:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9e5a5a1-bb13-49a6-839a-ab7f38c6e673","html_url":"https://github.com/Ishanoshada/Encodify","commit_stats":null,"previous_names":["ishanoshada/encodify"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ishanoshada%2FEncodify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ishanoshada%2FEncodify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ishanoshada%2FEncodify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ishanoshada%2FEncodify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ishanoshada","download_url":"https://codeload.github.com/Ishanoshada/Encodify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247934842,"owners_count":21020729,"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":["encode","encodify","marshal","python-encode","python-encryption","python-marshal","python-obfuscate"],"created_at":"2024-11-06T22:12:58.038Z","updated_at":"2025-04-10T03:32:49.741Z","avatar_url":"https://github.com/Ishanoshada.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Encodify - Python Code Encoding Module\n\n![Python Version](https://img.shields.io/badge/python-3.9-blue.svg)\n\n`encodify` is a powerful Python module designed to provide a suite of advanced encoding techniques for Python scripts. These encoding methods encompass compression, base64 encoding, and XOR encryption, allowing users to obfuscate code for enhanced security or distribution.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Importing the Module](#importing-the-module)\n  - [Creating an Encoder Instance](#creating-an-encoder-instance)\n  - [Encoding Specific Code](#encoding-specific-code)\n  - [Generating Random Payload](#generating-random-payload)\n  - [Generating Payload with a Specific Encoding Method](#generating-payload-with-a-specific-encoding-method)\n  - [Additional Customization](#additional-customization)\n- [Advanced Techniques](#advanced-techniques)\n- [Examples](#examples)\n- [Best Practices and Considerations](#best-practices-and-considerations)\n- [License](#license)\n\n## Installation\n\nTo integrate `encodify` into your project, you can use `pip`:\n\n```bash\npip install encodify\n```\n\n## Usage\n\n### Importing the Module\n\nTo employ the functionalities of `encodify`, import the `Encodify` class from the module:\n\n```python\nfrom encodify import Encodify\n```\n\n### Creating an Encoder Instance\n\nInstantiate the `Encodify` class to access a wide array of encoding techniques:\n\n```python\nencoder = Encodify()\n```\n\n### Encoding Specific Code\n\n`encodify` excels at encoding specific Python code snippets. For instance, utilizing the `m1` encoding method:\n\n```python\ncode_to_encode = \"print('Hello, World!')\"\nencoded_code = encoder.m1(code_to_encode)\n```\n\n### Generating Random Payload\n\nFor a dynamically selected encoding method, use the `random_payload` method. It produces a randomized payload, increasing the level of code obfuscation:\n\n```python\nrandom_payload = encoder.random_payload(\"print('Hello, World!')\", 2)\n```\n\n### Generating Payload with a Specific Encoding Method\n\nTailor the encoding method to your requirements with the `gen_payload` method. Specify the method number to achieve the desired encoding:\n\n```python\n# Choose the encoding method (e.g., m2)\nchosen_encoding_method = 2\npayload = encoder.gen_payload(chosen_encoding_method, \"print('Hello, World!')\")\n```\n\n### Additional Customization\n\n`encodify` offers extensive customization options. These include string replacements and appending/prepending custom code to the encoded output, allowing for fine-tuned control over the obfuscation process.\n\n### Args for `gen_payload` Function\n\nThe `gen_payload` function accepts the following arguments:\n\n- `choice` (int): The chosen encoding technique, determining the applied encoding method. Refer to the module documentation for a complete list of available choices.\n\n- `data` (str): The Python code to be encoded.\n\n- `line` (int, optional): The number of lines for line-based encoding (default is 2). This argument is applicable for specific encoding methods.\n\n- `options` (dict, optional): Further customization options (default is None). This may encompass string replacements or the addition of custom code.\n\n### Available Encoding Methods\n\n```plaintext\n+------+---------------------------------------------------+\n|  No  |           Encoding Method Description            |\n+------+---------------------------------------------------+\n|  1   |              m1: Gzip + Marshal + Base64          |\n|  2   |          m2: LZMA + Base64 + Marshal              |\n|  3   |         m3: LZMA + Base85 + Marshal               |\n|  4   |              m4: LZMA + Marshal                   |\n|  5   |          m5: Base64 + LZMA + Marshal              |\n|  6   |       m6: LZMA + Zlib + Marshal + Base64         |\n|  7   |     m7: LZMA + Gzip + Marshal + Base64           |\n|  8   |              m8: LZMA + Marshal                   |\n|  9   |       m9: Base64 + Gzip + Marshal + Base64        |\n|  10  |      m10: Base64 + Gzip + Marshal + LZMA          |\n|  11  |     m11: Base64 + Gzip + Marshal + Base64         |\n|  20  |     m20: Minify + Base64 + Gzip + Marshal         |\n|  23  |      l1: Line-based Encoding with Base85          |\n|  24  |  l2: Line-based Encoding with Base85 + LZMA       |\n|  25  |  l25: Line-based Encoding with Base64 + LZMA      |\n|  26  | l26: Line-based Encoding with Base64 + Codecs     |\n|  27  |  l27: Line-based Encoding with XOR Encryption     |\n|  28  | l28: Line-based Encoding with Base64 + XOR        |\n|  29  | l29: Line-based Encoding with Base64 + XOR        |\n|  30  | l30: Line-based Encoding with XOR + Codecs        |\n+------+---------------------------------------------------+\n```\n\n\n## Advanced Techniques\n\n`encodify` offers an array of advanced encoding techniques. These include line-based encoding, various combinations of compression, and XOR encryption. For in-depth guidance on these techniques, refer to the module's extensive documentation.\n\n## Examples\n\nExplore some advanced examples showcasing the versatility of `encodify`:\n\n```python\nfrom encodify import Encodify\n\n# Create an instance of Encodify\nencoder = Encodify()\n\n# Example 1: Encoding with m2 method\ncode_to_encode = \"for i in range(5):\\n    print(f'Number: {i}')\"\nencoded_code_m2 = encoder.m2(code_to_encode)\n\n# Example 2: Encoding with l1 method\nline_based_code = \"print('Hello, World!')\"\nencoded_line_based_code = encoder.l1(line_based_code, 3)\n\n# Example 3: Generating a random payload\nrandom_payload = encoder.random_payload(\"print('Hello, World!')\", 2)\n\n# Example 4: Generating a payload with a specific encoding method (m11)\nchosen_encoding_method = 11\npayload_m11 = encoder.gen_payload(chosen_encoding_method, \"print('Hello, World!')\")\n\n# Example 5: Customizing output with options\noptions = {\n    \"replace_strings\": {\"print\": \"display\"},\n    \"prepend_code\": \"import datetime\\n\",\n    \"append_code\": \"\\nprint(f'Execution Time: {datetime.datetime.now()}')\"\n}\ncustomized_payload = encoder.gen_payload(1, \"print('Hello, World!')\", options=options)\n\n```\n\n## Best Practices and Considerations\n\n1. **Use Responsibly**: This module is primarily intended for educational purposes. Use it responsibly and within the boundaries of applicable laws and ethical guidelines.\n\n2. **Testing and Verification**: Always test the encoded code to ensure it functions as expected.\n\n3. **Documentation**: Document the encoding method used and keep a record for future reference.\n\n**Repository Views** ![Views](https://profile-counter.glitch.me/encodify/count.svg)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fishanoshada%2Fencodify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fishanoshada%2Fencodify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fishanoshada%2Fencodify/lists"}