{"id":19924570,"url":"https://github.com/artemis-beta/enigma-cpp","last_synced_at":"2025-08-26T09:14:17.384Z","repository":{"id":81705975,"uuid":"236507483","full_name":"artemis-beta/enigma-cpp","owner":"artemis-beta","description":"A C++ variant on the Python Enigma machine contained within the enigma repository","archived":false,"fork":false,"pushed_at":"2025-05-27T08:20:13.000Z","size":225,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-27T09:31:34.138Z","etag":null,"topics":["cipher","enigma","simulation"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artemis-beta.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-01-27T14:22:25.000Z","updated_at":"2025-05-27T08:20:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"281d7721-49a5-4e0f-a9fd-d17ffa3e3c66","html_url":"https://github.com/artemis-beta/enigma-cpp","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/artemis-beta/enigma-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemis-beta%2Fenigma-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemis-beta%2Fenigma-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemis-beta%2Fenigma-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemis-beta%2Fenigma-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artemis-beta","download_url":"https://codeload.github.com/artemis-beta/enigma-cpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemis-beta%2Fenigma-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272201574,"owners_count":24891030,"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-26T02:00:07.904Z","response_time":60,"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":["cipher","enigma","simulation"],"created_at":"2024-11-12T22:18:05.967Z","updated_at":"2025-08-26T09:14:17.371Z","avatar_url":"https://github.com/artemis-beta.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ENIGMA\n![Enigma](https://github.com/artemis-beta/enigma-cpp/workflows/Enigma/badge.svg?event=push) [![CodeFactor](https://www.codefactor.io/repository/github/artemis-beta/enigma-cpp/badge)](https://www.codefactor.io/repository/github/artemis-beta/enigma-cpp)[![codecov](https://codecov.io/gh/artemis-beta/enigma-cpp/branch/master/graph/badge.svg)](https://codecov.io/gh/artemis-beta/enigma-cpp)\n\nThis is a small application written in C++ which simulates both the M3 and M4, 3 and 4 rotor variants of the Enigma machine which was utilised by German forces during WWII to encode information. It is a copy of the Python version found [here](https://github.com/artemis-beta/enigma).\n\n## App\n\nIncluded within this package is a demo application which provides a terminal based user interface. The application is built with `CMake\u003e=3.20`:\n\n```\nmkdir build\ncd build\ncmake ..\ncd ..\n./applications/bin/enigma_app\n```\n\nRunning the app will allow the user to specify settings such as the key, the rotor type choice (unique numbers from 1-8), and rotating the internal wiring within each rotor (Ringstellung). The user enters then enters their input next to the `INPUT: ` prompt. The machine can be reset at any point to the start settings for decoding using the `reset` command within the app. Quit the application using the `quit` command.\n\n## Custom Machine\n\nTo create a new instance of Enigma the default can be used which is an M3 instance with pre-selected rotor arrangement and reflector choice, or all settings can be chosen by the user. Note as with the machine itself, one of the 8 numbered rotor types may only be selected once.\n\n```\n#include \"Enigma.hxx\"\n\n#include \u003cvector\u003e\n#include \u003cstring\u003e\n#include \u003ciostream\u003e\n\nint main(int argc, char** argv)\n{\n    const std::vector\u003cint\u003e my_rotor_list = {1, 4, 6, 4}; // 3 or 4 of 1,2,3,4,5,6,7,8\n    const char my_reflector = 'B';                       // 'B' or 'C'\n    const std::string machine_type = \"M4\";               // 'M3' or 'M4' (should match rotor list)\n    const bool debug_mode = false;                       // Run Enigma in debug mode\n\n    Enigma* enigma = new Enigma( my_rotor_list, my_reflector, machine_type, debug_mode );\n\n    enigma-\u003eringstellung(\"right\", 2);   // Perform an internal wire rotation on the right rotor of 2 steps\n                                        // for M3 the rotors are {\"left\", \"middle\", \"right\"}\n                                        // for M4 the rotors are {\"left\", \"middle left\", \"middle right\", \"right\"}\n    \n    const std::string key = \"NERO\";\n    const std::string phrase = \"NOBODYEXPECTSTHESPANISHINQUISITION\";\n\n    enigma-\u003eset_key(key);\n    \n    const std::string cipher = enigma-\u003etype_phrase(phrase);\n\n    std::cout \u003c\u003c phrase \u003c\u003c \" -\u003e \" \u003c\u003c cipher;\n\n    return 0;\n}\n```\n\n## Unit Tests\n\nFor testing Enigma during the development Google Test has been included within the build procedure when running CMake, to launch the included unit tests run the executable within the `tests` folder:\n\n`./tests/bin/Enigma-unit_tests`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemis-beta%2Fenigma-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartemis-beta%2Fenigma-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemis-beta%2Fenigma-cpp/lists"}