{"id":22025160,"url":"https://github.com/experiencedeveloper/effective-encryption-tool","last_synced_at":"2025-10-04T14:27:09.682Z","repository":{"id":262685184,"uuid":"888036390","full_name":"Experiencedeveloper/Effective-Encryption-Tool","owner":"Experiencedeveloper","description":"A highly effective encryption tool with more features in later versions. ","archived":false,"fork":false,"pushed_at":"2024-12-07T11:10:19.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T16:49:10.939Z","etag":null,"topics":["c"],"latest_commit_sha":null,"homepage":"","language":null,"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/Experiencedeveloper.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":"2024-11-13T17:46:38.000Z","updated_at":"2024-12-07T11:10:22.000Z","dependencies_parsed_at":"2024-12-07T12:18:15.998Z","dependency_job_id":"93dfb6ab-354c-4a05-b677-b8d39b5d97f9","html_url":"https://github.com/Experiencedeveloper/Effective-Encryption-Tool","commit_stats":null,"previous_names":["experiencedeveloper/effective-encryption-tool-"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Experiencedeveloper/Effective-Encryption-Tool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Experiencedeveloper%2FEffective-Encryption-Tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Experiencedeveloper%2FEffective-Encryption-Tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Experiencedeveloper%2FEffective-Encryption-Tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Experiencedeveloper%2FEffective-Encryption-Tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Experiencedeveloper","download_url":"https://codeload.github.com/Experiencedeveloper/Effective-Encryption-Tool/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Experiencedeveloper%2FEffective-Encryption-Tool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278323637,"owners_count":25968165,"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-10-04T02:00:05.491Z","response_time":63,"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":["c"],"created_at":"2024-11-30T07:14:41.840Z","updated_at":"2025-10-04T14:27:09.628Z","avatar_url":"https://github.com/Experiencedeveloper.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Effective Encryption Tool\n\n## Overview\nThe Effective Encryption Tool is a versatile program designed for encrypting and decrypting messages using multiple cipher methods. This tool provides a user-friendly interface and ensures secure communication through various encryption techniques.\n\n## Features\n### v1.0: \"Initial Release, Alpha or Beta Development Stage, Great Encryption\"\n- **Substitution Cipher**: Encrypts and decrypts messages by substituting each letter with a different one based on a predefined key.\n- **Random Key Generation**: Generates a random substitution key for encryption.\n- **Custom Key Input**: Allows users to input their own substitution key.\n- **Interactive User Interface**: Uses `ncurses` for a text-based UI, providing a smooth user experience.\n\n### v2.0: \"Best Encryption, Beta Development Stage\"\n- **Substitution Cipher**\n- **Caesar Cipher**: Encrypts and decrypts messages by shifting each letter by a specified number of places in the alphabet.\n- **Vigenère Cipher**: Encrypts and decrypts messages using a keyword.\n- **Enhanced ncurses-based UI**: Improved user interface for better usability.\n- **Improved Key Validation**: Ensures custom keys are valid and secure.\n\n### v3.0: \"Possibly Complete, Top-notch Encryption\"\n- **All features from v2.0**\n- **AES-256 Encryption**: Provides robust encryption using the Advanced Encryption Standard.\n\n## Installation\n1. **Requirements**:\n    - A C compiler (e.g., GCC)\n    - `ncurses` library installed on your system\n    - OpenSSL library for AES-256 (for v3.0)\n\n2. **Installation Steps**:\n    ```sh\n    sudo apt-get install gcc ncurses-dev libssl-dev\n    ```\n\n3. **Compile the Program**:\n    ```sh\n    gcc -o encryption_tool encryption_tool.c -lncurses -lssl -lcrypto\n    ```\n\n## Usage\n1. **Running the Program**:\n    ```sh\n    ./encryption_tool\n    ```\n\n2. **Key Generation**:\n    - Press 'r' to generate a random key.\n    - Press 'c' to enter a custom key.\n\n3. **Message Encryption**:\n    - Enter your message when prompted.\n    - The tool will display the encrypted message.\n\n4. **Message Decryption**:\n    - The tool automatically decrypts the encrypted message and displays it.\n\n## Cipher Methods\n### Substitution Cipher\n- Substitutes each letter in the plaintext with a different letter based on a predefined key.\n- Example Key: \"QWERTYUIOPASDFGHJKLZXCVBNM\"\n- Example: \"HELLO\" -\u003e \"ITSSG\" (using the above key)\n\n### Caesar Cipher\n- (Coming in v2.0) Shifts each letter in the plaintext by a specified number of places.\n- Example Shift: 3\n- Example: \"HELLO\" -\u003e \"KHOOR\"\n\n### Vigenère Cipher\n- (Coming in v2.0) Uses a keyword to shift letters, providing more security than the Caesar cipher.\n- Example Keyword: \"KEY\"\n- Example: \"HELLO\" -\u003e \"RIJVS\" (using the keyword \"KEY\")\n\n### AES-256 Encryption\n- (Coming in v3.0) Uses the Advanced Encryption Standard for robust encryption.\n- Example: Encrypting \"HELLO\" will produce a secure, non-readable ciphertext.\n\n## Code Structure\n### encryption_tool.c\n```c\n#include \u003cstdio.h\u003e\n#include \u003cstdlib.h\u003e\n#include \u003ctime.h\u003e\n#include \u003cstring.h\u003e\n#include \u003cctype.h\u003e\n#include \u003cncurses.h\u003e\n\n// Function to generate a random substitution key\nvoid generate_random_key(char* key) {\n    int alphabet[26] = {0};\n    for (int i = 0; i \u003c 26; i++) {\n        int randIndex;\n        do {\n            randIndex = rand() % 26;\n        } while (alphabet[randIndex] != 0);\n        alphabet[randIndex] = 1;\n        key[i] = 'A' + randIndex;\n    }\n    key[26] = '\\0';\n}\n\n// Function to encrypt the message\nvoid encrypt(const char* message, const char* key, char* encrypted) {\n    for (size_t i = 0; i \u003c strlen(message); i++) {\n        if (isalpha(message[i])) {\n            char base = islower(message[i]) ? 'a' : 'A';\n            encrypted[i] = key[message[i] - base];\n        } else {\n            encrypted[i] = message[i];\n        }\n    }\n    encrypted[strlen(message)] = '\\0';\n}\n\n// Function to decrypt the message\nvoid decrypt(const char* encrypted, const char* key, char* decrypted) {\n    for (size_t i = 0; i \u003c strlen(encrypted); i++) {\n        if (isalpha(encrypted[i])) {\n            char base = islower(encrypted[i]) ? 'a' : 'A';\n            for (int j = 0; j \u003c 26; j++) {\n                if (key[j] == encrypted[i]) {\n                    decrypted[i] = base + j;\n                    break;\n                }\n            }\n        } else {\n            decrypted[i] = encrypted[i];\n        }\n    }\n    decrypted[strlen(encrypted)] = '\\0';\n}\n\nint main() {\n    char* message = (char*)malloc(256 * sizeof(char));\n    char key[27];\n    char* encrypted = (char*)malloc(256 * sizeof(char));\n    char* decrypted = (char*)malloc(256 * sizeof(char));\n\n    if (message == NULL || encrypted == NULL || decrypted == NULL) {\n        printf(\"Memory allocation failed\\n\");\n        return 1;\n    }\n\n    // Initialize random seed\n    srand(time(NULL));\n\n    // Initialize ncurses\n    initscr();\n    cbreak();\n    echo();  // Enable echo to make characters visible while typing\n    keypad(stdscr, TRUE);\n    \n    // Create windows for input and output\n    WINDOW *inputwin = newwin(10, 50, 0, 0);\n    WINDOW *outputwin = newwin(20, 50, 12, 0);  // Increase the height of the output window\n    box(inputwin, 0, 0);\n    box(outputwin, 0, 0);\n    mvwprintw(inputwin, 0, 1, \" Input \");\n    mvwprintw(outputwin, 0, 1, \" Output \");\n    refresh();\n    wrefresh(inputwin);\n    wrefresh(outputwin);\n\n    // Loop for key generation input\n    while (1) {\n        mvwprintw(inputwin, 1, 1, \"Press 'r' for random key, 'c' for custom key: \");\n        wrefresh(inputwin);\n        int ch = wgetch(inputwin);\n\n        if (ch == 'r') {\n            generate_random_key(key);\n            mvwprintw(inputwin, 2, 1, \"Generated Key: %s\", key);\n            break;\n        } else if (ch == 'c') {\n            mvwprintw(inputwin, 2, 1, \"Enter the custom key (26 unique letters): \");\n            wrefresh(inputwin);\n            wgetnstr(inputwin, key, 26);\n            if (strlen(key) != 26) {\n                mvwprintw(inputwin, 3, 1, \"Invalid key length. Press any key to exit...\");\n                wrefresh(inputwin);\n                wgetch(inputwin);\n                endwin();\n                return 1;\n            }\n            break;\n        } else {\n            mvwprintw(inputwin, 2, 1, \"Invalid option. Press any key to try again...\");\n            wrefresh(inputwin);\n            wgetch(inputwin);\n        }\n        wrefresh(inputwin);\n    }\n\n    // Loop for message input\n    while (1) {\n        // Prompt for the message\n        mvwprintw(inputwin, 4, 1, \"Enter the message (type 'q' to quit): \");\n        wrefresh(inputwin);\n        wgetnstr(inputwin, message, 255);\n\n        // Check if the user wants to exit\n        if (strcmp(message, \"q\") == 0) {\n            break;\n        }\n\n        // Encrypt and display the message\n        encrypt(message, key, encrypted);\n        mvwprintw(outputwin, 1, 1, \"Encrypted message: %s\", encrypted);\n        wrefresh(outputwin);\n\n        // Display a gap of 5 lines before the decrypted message\n        for (int i = 2; i \u003c 7; i++) {\n            mvwprintw(outputwin, i, 1, \"\");\n        }\n\n        // Decrypt and display the message\n        decrypt(encrypted, key, decrypted);\n        mvwprintw(outputwin, 7, 1, \"Decrypted message: %s\", decrypted);\n        wrefresh(outputwin);\n    }\n\n    // End ncurses\n    endwin();\n\n    // Free allocated memory\n    free(message);\n    free(encrypted);\n    free(decrypted);\n\n    return 0;\n}\n```\n\n## Future Enhancements\n- Adding more encryption methods (e.g., Vigenère cipher, Caesar cipher in v2.0, AES-256 in v3.0).\n- Improving the user interface with more features and better navigation.\n- Enhancing error handling and input validation.\n- Providing unit tests and example scripts for better usability and reliability.\n\n## Contribution\n- Feel free to fork the repository and submit pull requests for any improvements or new features.\n\n## License\n- This project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexperiencedeveloper%2Feffective-encryption-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexperiencedeveloper%2Feffective-encryption-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexperiencedeveloper%2Feffective-encryption-tool/lists"}