All Projects → cedricbonhomme → pyEnigma

cedricbonhomme / pyEnigma

Licence: GPL-3.0 license
Python Enigma cypher machine simulator.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pyEnigma

enigma
Enigma cipher machine emulator (CLI + library) written in Go
Stars: ✭ 50 (+13.64%)
Mutual labels:  enigma, enigma-simulator, enigma-machine
enigma-go
Go library for consuming Qlik's Associative Engine.
Stars: ✭ 36 (-18.18%)
Mutual labels:  engine, enigma
pokengine
An online Pokémon battle system for the web
Stars: ✭ 45 (+2.27%)
Mutual labels:  simulator, engine
ultra
Cryptanalysis of the Enigma machine in Rust.
Stars: ✭ 14 (-68.18%)
Mutual labels:  enigma, enigma-machine
PokemonBattleEngine
A C# library that can emulate Pokémon battles.
Stars: ✭ 92 (+109.09%)
Mutual labels:  simulator, engine
sim8085
Online 8085 simulator
Stars: ✭ 83 (+88.64%)
Mutual labels:  simulator
ARMStrong
A fast and simple ARM Simulator made for education based upon Unicorn and Keystone engines
Stars: ✭ 99 (+125%)
Mutual labels:  simulator
foreman column view
A simple Foreman plugin showcasing Deface for altering the Hosts view
Stars: ✭ 23 (-47.73%)
Mutual labels:  engine
WurfelEngineSDK
Isometric game engine. Open world, block/voxel based and sprite rendering.
Stars: ✭ 96 (+118.18%)
Mutual labels:  engine
duel-masters
Browser based Duel Masters simulator.
Stars: ✭ 28 (-36.36%)
Mutual labels:  simulator
modular-psu-firmware
Firmware for EEZ Bench Box 3 (BB3)
Stars: ✭ 74 (+68.18%)
Mutual labels:  simulator
elk
A low footprint JavaScript engine for embedded systems
Stars: ✭ 1,458 (+3213.64%)
Mutual labels:  engine
delphi3d-engine
A 3D-graphic and game engine for Delphi and Windows.
Stars: ✭ 52 (+18.18%)
Mutual labels:  engine
Hack-System
[HackSystem/Hack System] 有趣而炫酷的模拟操作系统。An interesting and cool simulation operating system.
Stars: ✭ 35 (-20.45%)
Mutual labels:  simulator
SlimTracin
Software ray tracer written from scratch in C that can run on CPU or GPU with emphasis on ease of use and trivial setup
Stars: ✭ 49 (+11.36%)
Mutual labels:  engine
CoinBrowser
Coinbrowser is a pair selection tool for Freqtrade and a simple crypto trading-simulator
Stars: ✭ 25 (-43.18%)
Mutual labels:  simulator
gym-mtsim
A general-purpose, flexible, and easy-to-use simulator alongside an OpenAI Gym trading environment for MetaTrader 5 trading platform (Approved by OpenAI Gym)
Stars: ✭ 196 (+345.45%)
Mutual labels:  simulator
exengine
A C99 3D game engine
Stars: ✭ 487 (+1006.82%)
Mutual labels:  engine
interstellar-armada
A Javascript-WebGL 3D space combat game under development.
Stars: ✭ 33 (-25%)
Mutual labels:  simulator
MAPLEAF
6-DOF Rocket Flight Simulation Framework
Stars: ✭ 28 (-36.36%)
Mutual labels:  simulator

pyEnigma

builds.sr.ht status

pyEnigma is a Python Enigma cypher machine simulator.

For reporting issues, visit the tracker here: https://todo.sr.ht/~cedric/pyenigma

Usage

As a Python library

You can install pyEnigma with Poetry.

$ poetry install pyenigma

Then you can use it in your program:

$ poetry shell
(pyenigma-X0xzv6Ge-py3.8) $
(pyenigma-X0xzv6Ge-py3.8) $ python
Python 3.8.0 (default, Dec 11 2019, 21:43:13)
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyenigma import enigma
>>> from pyenigma import rotor
>>> print(rotor.ROTOR_GR_III)

    Name: III
    Model: German Railway (Rocket)
    Date: 7 February 1941
    Wiring: JVIUBHTCDYAKEQZPOSGXNRMWFL
>>>
>>> engine = enigma.Enigma(rotor.ROTOR_Reflector_A, rotor.ROTOR_I,
                                rotor.ROTOR_II, rotor.ROTOR_III, key="ABC",
                                plugs="AV BS CG DL FU HZ IN KM OW RX")
>>> print(engine)

    Reflector:
    Name: Reflector A
    Model: None
    Date: None
    Wiring: EJMZALYXVBWFCRQUONTSPIKHGD

    Rotor 1:
    Name: I
    Model: Enigma 1
    Date: 1930
    Wiring: EKMFLGDQVZNTOWYHXUSPAIBRCJ
    State: A

    Rotor 2:
    Name: II
    Model: Enigma 1
    Date: 1930
    Wiring: AJDKSIRUXBLHWTMCQGZNPYFVOE
    State: B

    Rotor 3:
    Name: III
    Model: Enigma 1
    Date: 1930
    Wiring: BDFHJLCPRTXVZNYEIWGAKMUSQO
    State: C
>>> secret = engine.encipher("Hello World")
>>> print(secret)
Qgqop Vyzxp

As a program

Install pyEnigma system wide with pipx:

$ pipx install pyenigma

Then you can use the command line interface:

$ echo "Hello World" | enigma ABC A  I II III "AV BS CG DL FU HZ IN KM OW RX"
Qgqop Vyzxp

$ echo "Qgqop Vyzxp" | enigma ABC A  I II III "AV BS CG DL FU HZ IN KM OW RX"
Hello World

If you want to display the rotor output state:

$ echo "Hello World" | enigma ABC A I II III "AV BS CG DL FU HZ IN KM OW RX" --verbose
Qgqop Vyzxp
KBC A I II III "AV BS CG DL FU HZ IN KM OW RX"

The state is returned on stderr, so you can still use the Unix pipe mechanism:

$ 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"
KBC A I II III "AV BS CG DL FU HZ IN KM OW RX"
Hello World

License

pyEnigma is licensed under GNU General Public License version 3

Author

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].