{"id":26732117,"url":"https://github.com/cedricbonhomme/pyenigma","last_synced_at":"2025-04-08T03:19:34.894Z","repository":{"id":50578045,"uuid":"85051277","full_name":"cedricbonhomme/pyEnigma","owner":"cedricbonhomme","description":"Python Enigma cypher machine simulator.","archived":false,"fork":false,"pushed_at":"2025-01-13T19:26:46.000Z","size":292,"stargazers_count":70,"open_issues_count":1,"forks_count":14,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-28T00:49:50.422Z","etag":null,"topics":["engine","enigma","enigma-machine","enigma-simulator","simulator"],"latest_commit_sha":null,"homepage":"https://github.com/cedricbonhomme/pyEnigma","language":"Python","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/cedricbonhomme.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","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":"2017-03-15T09:05:15.000Z","updated_at":"2025-03-11T03:58:19.000Z","dependencies_parsed_at":"2023-10-03T05:43:41.115Z","dependency_job_id":"36064347-a28e-4aba-aba4-6e9734d07195","html_url":"https://github.com/cedricbonhomme/pyEnigma","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedricbonhomme%2FpyEnigma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedricbonhomme%2FpyEnigma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedricbonhomme%2FpyEnigma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedricbonhomme%2FpyEnigma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedricbonhomme","download_url":"https://codeload.github.com/cedricbonhomme/pyEnigma/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767239,"owners_count":20992548,"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":["engine","enigma","enigma-machine","enigma-simulator","simulator"],"created_at":"2025-03-28T00:49:59.639Z","updated_at":"2025-04-08T03:19:34.878Z","avatar_url":"https://github.com/cedricbonhomme.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyEnigma\n\n[![builds.sr.ht status](https://builds.sr.ht/~cedric/pyenigma.svg)](https://builds.sr.ht/~cedric/pyenigma)\n\n\n[pyEnigma](https://sr.ht/~cedric/pyenigma) is a  Python Enigma cypher machine\nsimulator.\n\nFor reporting issues, visit the tracker here:\nhttps://todo.sr.ht/~cedric/pyenigma\n\n\n## Usage\n\n\n### As a Python library\n\nYou can install pyEnigma with Poetry.\n\n```bash\n$ poetry install pyenigma\n```\n\nThen you can use it in your program:\n\n```bash\n$ poetry shell\n(pyenigma-py3.12) $\n(pyenigma-py3.12) $ python\n```\n\n```python\nPython 3.12.1 (main, Dec 31 2023, 00:21:59) [GCC 12.2.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e from pyenigma import enigma\n\u003e\u003e\u003e from pyenigma import rotor\n\u003e\u003e\u003e print(rotor.ROTOR_GR_III)\n\n    Name: III\n    Model: German Railway (Rocket)\n    Date: 7 February 1941\n    Wiring: JVIUBHTCDYAKEQZPOSGXNRMWFL\n\u003e\u003e\u003e\n\u003e\u003e\u003e engine = enigma.Enigma(rotor.ROTOR_Reflector_A, rotor.ROTOR_I,\n                                rotor.ROTOR_II, rotor.ROTOR_III, key=\"ABC\",\n                                plugs=\"AV BS CG DL FU HZ IN KM OW RX\")\n\u003e\u003e\u003e print(engine)\n\n    Reflector:\n    Name: Reflector A\n    Model: None\n    Date: None\n    Wiring: EJMZALYXVBWFCRQUONTSPIKHGD\n\n    Rotor 1:\n    Name: I\n    Model: Enigma 1\n    Date: 1930\n    Wiring: EKMFLGDQVZNTOWYHXUSPAIBRCJ\n    State: A\n\n    Rotor 2:\n    Name: II\n    Model: Enigma 1\n    Date: 1930\n    Wiring: AJDKSIRUXBLHWTMCQGZNPYFVOE\n    State: B\n\n    Rotor 3:\n    Name: III\n    Model: Enigma 1\n    Date: 1930\n    Wiring: BDFHJLCPRTXVZNYEIWGAKMUSQO\n    State: C\n\u003e\u003e\u003e secret = engine.encipher(\"Hello World\")\n\u003e\u003e\u003e print(secret)\nQgqop Vyzxp\n```\n\n### As a program\n\nInstall pyEnigma system wide with pipx:\n\n```bash\n$ pipx install pyenigma\n```\n\nThen you can use the command line interface:\n\n```bash\n$ echo \"Hello World\" | enigma ABC A  I II III \"AV BS CG DL FU HZ IN KM OW RX\"\nQgqop Vyzxp\n\n$ echo \"Qgqop Vyzxp\" | enigma ABC A  I II III \"AV BS CG DL FU HZ IN KM OW RX\"\nHello World\n```\n\nIf you want to display the rotor output state:\n\n```bash\n$ echo \"Hello World\" | enigma ABC A I II III \"AV BS CG DL FU HZ IN KM OW RX\" --verbose\nQgqop Vyzxp\nKBC A I II III \"AV BS CG DL FU HZ IN KM OW RX\"\n```\n\nThe state is returned on ```stderr```, so you can still use the Unix pipe mechanism:\n\n```bash\n$ echo \"Hello World\" | enigma ABC A I II III \"AV BS CG DL FU HZ IN KM OW RX\" --verbose | enigma ABC A I II III \"AV BS CG DL FU HZ IN KM OW RX\"\nKBC A I II III \"AV BS CG DL FU HZ IN KM OW RX\"\nHello World\n```\n\n\n## License\n\npyEnigma is licensed under\n[GNU General Public License version 3](https://www.gnu.org/licenses/gpl-3.0.html)\n\n\n## Author\n\n* [Christophe Goessen](https://github.com/cgoessen) (initial author)\n* [Cédric Bonhomme](https://www.cedricbonhomme.org)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedricbonhomme%2Fpyenigma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedricbonhomme%2Fpyenigma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedricbonhomme%2Fpyenigma/lists"}