enigma-cipher-machine


Nameenigma-cipher-machine JSON
Version 0.0.1 PyPI version JSON
download
home_page
SummaryThe enigma machine in python
upload_time2023-05-29 20:37:58
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Enigma

<p align="center">
    <img src="https://upload.wikimedia.org/wikipedia/commons/e/e1/Enigma-logo.jpg" alt="Engima logo" />
</p>

The enigma machine in python.

## The Machine

Built by the German Scherbius & Ritter company in the early 20th century, the enigma machine is a cipher machine. The machine performs substitution : it encodes a letter from the alphabet to another one.

<p align="center">
    <img src="https://upload.wikimedia.org/wikipedia/commons/b/bd/Enigma_%28crittografia%29_-_Museo_scienza_e_tecnologia_Milano.jpg" alt="Engima machine" height="400"/>
</p>

The machine is composed of the following elements:

- a keyboard for user input
- multiple rotors which are rotating parts that perform the cipher operation using a scrambled electrical wiring
- a front panel plugboard to allow additionnal substitution making the deciphering operation insanely more difficult (over 150,738,274,937,250 additionnal substitutions using 10 pairs)
- a light panel with 26 lamps labeled from A to Z.

The cipher process can be described as follow :

Keyboard -> Plugboard -> Entry Wheel -> Rotors (from 1 to x) -> Reflector -> Rotors (from x to 1) -> Entry Wheel -> Plugboard -> Light Panel

The user press a letter on the keyboard making the first rotor to rotate. The keyboard press close an electrical circuit, allowing the current to enter the plugboard, the entry wheel, each rotor and the reflector (a non rotating wheel). From there the electrical current makes it way back to the light panel, lighting up the alphabet letter corresponding to the cipher letter.

### Rotors

Rotors are the rotating part of the enigma machine. Most machines contains three of them but an additionnal one can be found (e.g. M4 variant for the Kriegsmarine with the _greek_ wheel).

Rotors' positions are numbered from A to Z and possess turnovers positions. When a rotor reach a turnover position, it rotates its closest neighbour.

Rotors' internal wiring can be shifted prior any operation by rotating a ring to a certain position. This setting is often called the _Ringstellung_.

The wiring pattern is usely represented with an alphabeter string. Each alphabet chacracter is replaced by the corresponding letter in the string. For instance the string: **EKMFLGDQVZNTOWYHXUSPAIBRCJ** means that a **A** substitute to an **E**, a **B** to an **K** and so on. The same logic applies for the remaining character as shown below.

```
ABCDEFGHIJKLMNOPQRSTUVWXYZ      keyboard    reflector  
||||||||||||||||||||||||||         ↓            ↑
EKMFLGDQVZNTOWYHXUSPAIBRCJ      reflector   keyboard
```

On each rotor increment, we rotate the alphabet by one (please pay attention to the position of the letter A):

```
BCDEFGHIJKLMNOPQRSTUVWXYZA
||||||||||||||||||||||||||
EKMFLGDQVZNTOWYHXUSPAIBRCJ
```

Moving the ring to a B position is equivalent to the inverse of a rotation.

```
ZABCDEFGHIJKLMNOPQRSTUVWXY
||||||||||||||||||||||||||
EKMFLGDQVZNTOWYHXUSPAIBRCJ
```

We can represent the shift with the following equations:

From the keyboard to the reflector (alphabet to rotor's wiring)
```
wiring_letter = letter + position - ringstellung
cipher_letter = wire.at(wiring_letter) - position + ringstellung
```

From the reflector to the light panel (rotor's wiring to alphabet)
```
wiring_letter = letter + position - rinsgtellung
cipher_letter = wire.index(wiring_letter) - position + ringstellung
```

The reflector is considered as a one-way (keyboard to reflector), non rotating "rotor".

Enigma machines that use a lever suffers an abnormal rotation when the center rotor reaches its turnover position, all the rotors are increment one step further.
Let's illustrate this anomaly.

- Rotor I turnover position is Q : if reached Rotor II increment,
- Rotor II turnover position  is E : if reached Rotor III increment.

We setup the machine to the A-D-Q position and we increment the Rotor I.

Expected rotation:

| III | II  |  I  |
|-----|-----|-----|
|  A  |  D  |  Q  |
|  A  |  E  |  R  |
|  A  |  E  |  S  |

Double stepping rotation:

| III | II  |  I  |
|-----|-----|-----|
|  A  |  D  |  Q  |
|  A  |  E  |  R  |
|  B  |  F  |  S  |

Rotor III, II and I increment. This software enables double stepping rotation by default as it was present on the M3 and M4 machine. You can desactivate this behaviour by setting `double_stepping=False` in the [Machine constructor](enigma/machine.py).

### Plugboard

The plugboard is a front panel with 26 electrical sockets. A male-male cable is used to connect letters between them. 10 connections (20 pairs) is a common setup.

An AB pair will substitute every A to B and every B to an A.

We use this notation : `AE BF CM DQ HU JN LX PR SZ VW`. Every pairs are space separated.

### Example

We use the M3 machine and the following setup:

| Object        | Value                             |
|---------------|-----------------------------------|
| Reflector     | C                                 |
| Rotors        | III-II-I                          |
| Positions     | A-B-C                             |
| Ringstellung  | D-E-F                             |
| Plugboard     | qd fe rw jn il ps cm ax kg yu     |
| Text          | Hello world                       |

The enigma produces: ```fsqsj fusta```


## Getting started

Get the library: 

```python
pip install enigma-machine
```

We use pure python, no dependency required and tested on python 3.10.6.

To run tests please install **pytest**.

## Usage

We want to decode the following message: `xgytk npnkq ssnxw kyf` with the settings extracted from the above example.

Start by initialise a plugboard, A plugboard object contains from 0 to 10 pairs of letters. A letter can only appears one time in the plugboard.

```python
from enigma.plugboard import Plugboard

plugboard = Plugboard("qd fe rw jn il ps cm ax kg yu")
```

Then make the machine using the predefined rotors (see below if you want to create yours).

```python
from enigma.rotor import Rotors
from enigma.machine import Machine

M3 = Machine(
    "M3",
    [
        Rotors.M3.ETW,
        Rotors.M3.I,
        Rotors.M3.II,
        Rotors.M3.III,
        Rotors.M3.UKWC
    ],
    plugboard
)

```

Now set the positions and the ringstellung:

```python
M3.set_rotor_position("I", "A")
M3.set_rotor_position("II", "B")
M3.set_rotor_position("III", "C")

M3.set_rotor_ringstellung("I", "D")
M3.set_rotor_ringstellung("II", "E")
M3.set_rotor_ringstellung("III", "F")
```

And then provide the input text (split is optionnal it adds an additionnal space every n character):

```python
plaintext = M3.encode("xgytk npnkq ssnxw kyf", split=0)
print(plaintext)
>> alanmathisonturing
```


Here is a full example using a M4 enigma machine with double stepping. We are decoding a real world message sent by GrossAdmiral Donitz on the 1st May 1945.

```python
from enigma.machine import Machine
from enigma.plugboard import Plugboard
from enigma.rotor import Rotors

plugboard = Plugboard("AE BF CM DQ HU JN LX PR SZ VW")

M4 = Machine(
    "M4",
    [
        Rotors.M4.ETW,
        Rotors.M4.VIII,
        Rotors.M4.VI,
        Rotors.M4.V,
        Rotors.M4.Beta,
        Rotors.M4.UKWC
    ],
    plugboard
)

M4.set_rotor_position("Beta", "C")
M4.set_rotor_position("V", "D")
M4.set_rotor_position("VI", "S")
M4.set_rotor_position("VIII", "Z")

M4.set_rotor_ringstellung("Beta", "E")
M4.set_rotor_ringstellung("V", "P")
M4.set_rotor_ringstellung("VI", "E")
M4.set_rotor_ringstellung("VIII", "L")

print(M4)

ciphertext = """LANO TCTO UARB BFPM HPHG CZXT DYGA HGUF XGEW KBLK GJWL QXXT
GPJJ AVTO CKZF SLPP QIHZ FXOE BWII EKFZ LCLO AQJU LJOY HSSM BBGW HZAN
VOII PYRB RTDJ QDJJ OQKC XWDN BBTY VXLY TAPG VEAT XSON PNYN QFUD BBHH
VWEP YEYD OHNL XKZD NWRH DUWU JUMW WVII WZXI VIUQ DRHY MNCY EFUA PNHO
TKHK GDNP SAKN UAGH JZSM JBMH VTRE QEDG XHLZ WIFU SKDQ VELN MIMI THBH
DBWV HDFY HJOQ IHOR TDJD BWXE MEAY XGYQ XOHF DMYU XXNO JAZR SGHP LWML
RECW WUTL RTTV LBHY OORG LGOW UXNX HMHY FAAC QEKT HSJW"""

plaintext = M4.encode(ciphertext, split=0, debug=False)

print(plaintext)
```

The machine returns :
```
krkrallexxfolgendesistsofortbekanntzugebenxxichhabefolgelnbebefehlerhaltenxxjansterledesbisherigxnreichsmarschallsjgoeringjsetztderfuehrersieyhvrrgrzssadmiralyalsseinennachfolgereinxschriftlschevollmachtunterwegsxabsofortsollensiesaemtlichemassnahmenverfuegenydiesichausdergegenwaertigenlageergebenxgezxreichsleiteikktulpekkjbormannjxxobxdxmmmdurnhfkstxkomxadmxuuubooiexkp
```

After formating
```
krkr alle xx 
folgendes ist sofort bekanntzugeben xx 
ich habe folgelnbe befehl erhalten xx 
j ansterle des bisherigxn reichsmarschalls j goering j setzt der fuehrer sie y hvrr grzssadmiral y als seinen nachfolger ein x schriftlsche vollmacht unterwegs x absofort sollen sie saemtliche massnahmen verfuegen y die sich aus der gegenwaertigen lage ergeben x gez x reichsleitei kk tulpe kk j bormann j xx
ob x d x mmm durnh fkst x kom x adm x uuu booie x kp
```

Please see [cryptomuseum.com](https://www.cryptomuseum.com/crypto/enigma/msg/p1030681.htm) for more.

## Going further

You can create additionnal rotors by using the `Rotor` class from the `enigma.rotor` package.

A plugboard object contains from 0 to 10 pairs of letters. A letter can only appears one time in the plugboard.

```python
from enigma.plugboard import Plugboard

plugboard = Plugboard("AE BF CM DQ HU JN LX PR SZ VW")
```

You can also randomise the plugboard:

```python
plugboard.randomise()
```


A Rotor object requires an unique name, the wiring sequence containing every letter of the alphabet (len(wiring) == 26) and the turnover positions. See [rotor.py](enigma/rotor.py) for the full api description.

```python
from enigma.rotor import Rotor

# Commercial Enigma A27 wiring
KI = Rotor(
    "KI",                           #name
    "LPGSZMHAEOQKVXRFYBUTNICJDW",   # wiring
    "Y"                             # turnover
)

KII = Rotor(
    "KII",
    "SLVGBTFXJQOHEWIRZYAMKPCNDU",
    "E"
)

KIII = Rotor(
    "KII",
    "CJGDPSHKTURAWZXFMYNQOBVLIE",
    "N"
)

ETWK = Rotor(
    "ETWK",
    "QWERTZUIOASDFGHJKPYXCVBNML",
    "",
    rotate=False                    # no rotation for an entry wheel
)

UKWK = Rotor(
    "UKWK",
    "IMETCGFRAYSQBZXWLHKDVUPOJN",
    "",
    reflector=True                  # this rotor is a reflector
)
```

A machine object requires a name, a list of rotors (starting from the entry wheel to the reflector) and a plugboard.

```python
from enigma.machine import Machine

EK = Machine(
    "K-A27",
    [
        ETWK,
        KI,
        KII,
        KIII,
        UKWK
    ],
    plugboard
)
```

## TODO

- [ ] set_rotor_position and set_rotor_ringstellung even if the rotor shares the same name

## Licence 

MIT of course.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "enigma-cipher-machine",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "Raymas <IgnaceCousteau@protonmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d8/ba/789e29a2b84db65b3c7a0c70df2576c2a33b56c47ee9d2c42b5570123961/enigma-cipher-machine-0.0.1.tar.gz",
    "platform": null,
    "description": "# Enigma\n\n<p align=\"center\">\n    <img src=\"https://upload.wikimedia.org/wikipedia/commons/e/e1/Enigma-logo.jpg\" alt=\"Engima logo\" />\n</p>\n\nThe enigma machine in python.\n\n## The Machine\n\nBuilt by the German Scherbius & Ritter company in the early 20th century, the enigma machine is a cipher machine. The machine performs substitution : it encodes a letter from the alphabet to another one.\n\n<p align=\"center\">\n    <img src=\"https://upload.wikimedia.org/wikipedia/commons/b/bd/Enigma_%28crittografia%29_-_Museo_scienza_e_tecnologia_Milano.jpg\" alt=\"Engima machine\" height=\"400\"/>\n</p>\n\nThe machine is composed of the following elements:\n\n- a keyboard for user input\n- multiple rotors which are rotating parts that perform the cipher operation using a scrambled electrical wiring\n- a front panel plugboard to allow additionnal substitution making the deciphering operation insanely more difficult (over 150,738,274,937,250 additionnal substitutions using 10 pairs)\n- a light panel with 26 lamps labeled from A to Z.\n\nThe cipher process can be described as follow :\n\nKeyboard -> Plugboard -> Entry Wheel -> Rotors (from 1 to x) -> Reflector -> Rotors (from x to 1) -> Entry Wheel -> Plugboard -> Light Panel\n\nThe user press a letter on the keyboard making the first rotor to rotate. The keyboard press close an electrical circuit, allowing the current to enter the plugboard, the entry wheel, each rotor and the reflector (a non rotating wheel). From there the electrical current makes it way back to the light panel, lighting up the alphabet letter corresponding to the cipher letter.\n\n### Rotors\n\nRotors are the rotating part of the enigma machine. Most machines contains three of them but an additionnal one can be found (e.g. M4 variant for the Kriegsmarine with the _greek_ wheel).\n\nRotors' positions are numbered from A to Z and possess turnovers positions. When a rotor reach a turnover position, it rotates its closest neighbour.\n\nRotors' internal wiring can be shifted prior any operation by rotating a ring to a certain position. This setting is often called the _Ringstellung_.\n\nThe wiring pattern is usely represented with an alphabeter string. Each alphabet chacracter is replaced by the corresponding letter in the string. For instance the string: **EKMFLGDQVZNTOWYHXUSPAIBRCJ** means that a **A** substitute to an **E**, a **B** to an **K** and so on. The same logic applies for the remaining character as shown below.\n\n```\nABCDEFGHIJKLMNOPQRSTUVWXYZ      keyboard    reflector  \n||||||||||||||||||||||||||         \u2193            \u2191\nEKMFLGDQVZNTOWYHXUSPAIBRCJ      reflector   keyboard\n```\n\nOn each rotor increment, we rotate the alphabet by one (please pay attention to the position of the letter A):\n\n```\nBCDEFGHIJKLMNOPQRSTUVWXYZA\n||||||||||||||||||||||||||\nEKMFLGDQVZNTOWYHXUSPAIBRCJ\n```\n\nMoving the ring to a B position is equivalent to the inverse of a rotation.\n\n```\nZABCDEFGHIJKLMNOPQRSTUVWXY\n||||||||||||||||||||||||||\nEKMFLGDQVZNTOWYHXUSPAIBRCJ\n```\n\nWe can represent the shift with the following equations:\n\nFrom the keyboard to the reflector (alphabet to rotor's wiring)\n```\nwiring_letter = letter + position - ringstellung\ncipher_letter = wire.at(wiring_letter) - position + ringstellung\n```\n\nFrom the reflector to the light panel (rotor's wiring to alphabet)\n```\nwiring_letter = letter + position - rinsgtellung\ncipher_letter = wire.index(wiring_letter) - position + ringstellung\n```\n\nThe reflector is considered as a one-way (keyboard to reflector), non rotating \"rotor\".\n\nEnigma machines that use a lever suffers an abnormal rotation when the center rotor reaches its turnover position, all the rotors are increment one step further.\nLet's illustrate this anomaly.\n\n- Rotor I turnover position is Q : if reached Rotor II increment,\n- Rotor II turnover position  is E : if reached Rotor III increment.\n\nWe setup the machine to the A-D-Q position and we increment the Rotor I.\n\nExpected rotation:\n\n| III | II  |  I  |\n|-----|-----|-----|\n|  A  |  D  |  Q  |\n|  A  |  E  |  R  |\n|  A  |  E  |  S  |\n\nDouble stepping rotation:\n\n| III | II  |  I  |\n|-----|-----|-----|\n|  A  |  D  |  Q  |\n|  A  |  E  |  R  |\n|  B  |  F  |  S  |\n\nRotor III, II and I increment. This software enables double stepping rotation by default as it was present on the M3 and M4 machine. You can desactivate this behaviour by setting `double_stepping=False` in the [Machine constructor](enigma/machine.py).\n\n### Plugboard\n\nThe plugboard is a front panel with 26 electrical sockets. A male-male cable is used to connect letters between them. 10 connections (20 pairs) is a common setup.\n\nAn AB pair will substitute every A to B and every B to an A.\n\nWe use this notation : `AE BF CM DQ HU JN LX PR SZ VW`. Every pairs are space separated.\n\n### Example\n\nWe use the M3 machine and the following setup:\n\n| Object        | Value                             |\n|---------------|-----------------------------------|\n| Reflector     | C                                 |\n| Rotors        | III-II-I                          |\n| Positions     | A-B-C                             |\n| Ringstellung  | D-E-F                             |\n| Plugboard     | qd fe rw jn il ps cm ax kg yu     |\n| Text          | Hello world                       |\n\nThe enigma produces: ```fsqsj fusta```\n\n\n## Getting started\n\nGet the library: \n\n```python\npip install enigma-machine\n```\n\nWe use pure python, no dependency required and tested on python 3.10.6.\n\nTo run tests please install **pytest**.\n\n## Usage\n\nWe want to decode the following message: `xgytk npnkq ssnxw kyf` with the settings extracted from the above example.\n\nStart by initialise a plugboard, A plugboard object contains from 0 to 10 pairs of letters. A letter can only appears one time in the plugboard.\n\n```python\nfrom enigma.plugboard import Plugboard\n\nplugboard = Plugboard(\"qd fe rw jn il ps cm ax kg yu\")\n```\n\nThen make the machine using the predefined rotors (see below if you want to create yours).\n\n```python\nfrom enigma.rotor import Rotors\nfrom enigma.machine import Machine\n\nM3 = Machine(\n    \"M3\",\n    [\n        Rotors.M3.ETW,\n        Rotors.M3.I,\n        Rotors.M3.II,\n        Rotors.M3.III,\n        Rotors.M3.UKWC\n    ],\n    plugboard\n)\n\n```\n\nNow set the positions and the ringstellung:\n\n```python\nM3.set_rotor_position(\"I\", \"A\")\nM3.set_rotor_position(\"II\", \"B\")\nM3.set_rotor_position(\"III\", \"C\")\n\nM3.set_rotor_ringstellung(\"I\", \"D\")\nM3.set_rotor_ringstellung(\"II\", \"E\")\nM3.set_rotor_ringstellung(\"III\", \"F\")\n```\n\nAnd then provide the input text (split is optionnal it adds an additionnal space every n character):\n\n```python\nplaintext = M3.encode(\"xgytk npnkq ssnxw kyf\", split=0)\nprint(plaintext)\n>> alanmathisonturing\n```\n\n\nHere is a full example using a M4 enigma machine with double stepping. We are decoding a real world message sent by GrossAdmiral Donitz on the 1st May 1945.\n\n```python\nfrom enigma.machine import Machine\nfrom enigma.plugboard import Plugboard\nfrom enigma.rotor import Rotors\n\nplugboard = Plugboard(\"AE BF CM DQ HU JN LX PR SZ VW\")\n\nM4 = Machine(\n    \"M4\",\n    [\n        Rotors.M4.ETW,\n        Rotors.M4.VIII,\n        Rotors.M4.VI,\n        Rotors.M4.V,\n        Rotors.M4.Beta,\n        Rotors.M4.UKWC\n    ],\n    plugboard\n)\n\nM4.set_rotor_position(\"Beta\", \"C\")\nM4.set_rotor_position(\"V\", \"D\")\nM4.set_rotor_position(\"VI\", \"S\")\nM4.set_rotor_position(\"VIII\", \"Z\")\n\nM4.set_rotor_ringstellung(\"Beta\", \"E\")\nM4.set_rotor_ringstellung(\"V\", \"P\")\nM4.set_rotor_ringstellung(\"VI\", \"E\")\nM4.set_rotor_ringstellung(\"VIII\", \"L\")\n\nprint(M4)\n\nciphertext = \"\"\"LANO TCTO UARB BFPM HPHG CZXT DYGA HGUF XGEW KBLK GJWL QXXT\nGPJJ AVTO CKZF SLPP QIHZ FXOE BWII EKFZ LCLO AQJU LJOY HSSM BBGW HZAN\nVOII PYRB RTDJ QDJJ OQKC XWDN BBTY VXLY TAPG VEAT XSON PNYN QFUD BBHH\nVWEP YEYD OHNL XKZD NWRH DUWU JUMW WVII WZXI VIUQ DRHY MNCY EFUA PNHO\nTKHK GDNP SAKN UAGH JZSM JBMH VTRE QEDG XHLZ WIFU SKDQ VELN MIMI THBH\nDBWV HDFY HJOQ IHOR TDJD BWXE MEAY XGYQ XOHF DMYU XXNO JAZR SGHP LWML\nRECW WUTL RTTV LBHY OORG LGOW UXNX HMHY FAAC QEKT HSJW\"\"\"\n\nplaintext = M4.encode(ciphertext, split=0, debug=False)\n\nprint(plaintext)\n```\n\nThe machine returns :\n```\nkrkrallexxfolgendesistsofortbekanntzugebenxxichhabefolgelnbebefehlerhaltenxxjansterledesbisherigxnreichsmarschallsjgoeringjsetztderfuehrersieyhvrrgrzssadmiralyalsseinennachfolgereinxschriftlschevollmachtunterwegsxabsofortsollensiesaemtlichemassnahmenverfuegenydiesichausdergegenwaertigenlageergebenxgezxreichsleiteikktulpekkjbormannjxxobxdxmmmdurnhfkstxkomxadmxuuubooiexkp\n```\n\nAfter formating\n```\nkrkr alle xx \nfolgendes ist sofort bekanntzugeben xx \nich habe folgelnbe befehl erhalten xx \nj ansterle des bisherigxn reichsmarschalls j goering j setzt der fuehrer sie y hvrr grzssadmiral y als seinen nachfolger ein x schriftlsche vollmacht unterwegs x absofort sollen sie saemtliche massnahmen verfuegen y die sich aus der gegenwaertigen lage ergeben x gez x reichsleitei kk tulpe kk j bormann j xx\nob x d x mmm durnh fkst x kom x adm x uuu booie x kp\n```\n\nPlease see [cryptomuseum.com](https://www.cryptomuseum.com/crypto/enigma/msg/p1030681.htm) for more.\n\n## Going further\n\nYou can create additionnal rotors by using the `Rotor` class from the `enigma.rotor` package.\n\nA plugboard object contains from 0 to 10 pairs of letters. A letter can only appears one time in the plugboard.\n\n```python\nfrom enigma.plugboard import Plugboard\n\nplugboard = Plugboard(\"AE BF CM DQ HU JN LX PR SZ VW\")\n```\n\nYou can also randomise the plugboard:\n\n```python\nplugboard.randomise()\n```\n\n\nA Rotor object requires an unique name, the wiring sequence containing every letter of the alphabet (len(wiring) == 26) and the turnover positions. See [rotor.py](enigma/rotor.py) for the full api description.\n\n```python\nfrom enigma.rotor import Rotor\n\n# Commercial Enigma A27 wiring\nKI = Rotor(\n    \"KI\",                           #name\n    \"LPGSZMHAEOQKVXRFYBUTNICJDW\",   # wiring\n    \"Y\"                             # turnover\n)\n\nKII = Rotor(\n    \"KII\",\n    \"SLVGBTFXJQOHEWIRZYAMKPCNDU\",\n    \"E\"\n)\n\nKIII = Rotor(\n    \"KII\",\n    \"CJGDPSHKTURAWZXFMYNQOBVLIE\",\n    \"N\"\n)\n\nETWK = Rotor(\n    \"ETWK\",\n    \"QWERTZUIOASDFGHJKPYXCVBNML\",\n    \"\",\n    rotate=False                    # no rotation for an entry wheel\n)\n\nUKWK = Rotor(\n    \"UKWK\",\n    \"IMETCGFRAYSQBZXWLHKDVUPOJN\",\n    \"\",\n    reflector=True                  # this rotor is a reflector\n)\n```\n\nA machine object requires a name, a list of rotors (starting from the entry wheel to the reflector) and a plugboard.\n\n```python\nfrom enigma.machine import Machine\n\nEK = Machine(\n    \"K-A27\",\n    [\n        ETWK,\n        KI,\n        KII,\n        KIII,\n        UKWK\n    ],\n    plugboard\n)\n```\n\n## TODO\n\n- [ ] set_rotor_position and set_rotor_ringstellung even if the rotor shares the same name\n\n## Licence \n\nMIT of course.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "The enigma machine in python",
    "version": "0.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/raymas/enigma-machine/issues",
        "Homepage": "https://github.com/raymas/enigma-machine"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8cc12079b3a93ab0c97e78943b6c563f4ae42079b6b8ea24d596f5173bbc3a95",
                "md5": "50221e0fc44aa8979341b9ca2b91f103",
                "sha256": "e7c67ba1f8e78262b8f47fbd4816ac7335b495a4b93500e3089ba99af744ce79"
            },
            "downloads": -1,
            "filename": "enigma_cipher_machine-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "50221e0fc44aa8979341b9ca2b91f103",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10202,
            "upload_time": "2023-05-29T20:37:55",
            "upload_time_iso_8601": "2023-05-29T20:37:55.993331Z",
            "url": "https://files.pythonhosted.org/packages/8c/c1/2079b3a93ab0c97e78943b6c563f4ae42079b6b8ea24d596f5173bbc3a95/enigma_cipher_machine-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d8ba789e29a2b84db65b3c7a0c70df2576c2a33b56c47ee9d2c42b5570123961",
                "md5": "9d9956b692444d78ca197bdb2ecaa19b",
                "sha256": "85b7abf3d481f559f11c1fa75d2706e7459bf7ee32bdca556d4ee48d866783d5"
            },
            "downloads": -1,
            "filename": "enigma-cipher-machine-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9d9956b692444d78ca197bdb2ecaa19b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 13263,
            "upload_time": "2023-05-29T20:37:58",
            "upload_time_iso_8601": "2023-05-29T20:37:58.087464Z",
            "url": "https://files.pythonhosted.org/packages/d8/ba/789e29a2b84db65b3c7a0c70df2576c2a33b56c47ee9d2c42b5570123961/enigma-cipher-machine-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-29 20:37:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "raymas",
    "github_project": "enigma-machine",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "enigma-cipher-machine"
}
        
Elapsed time: 0.08145s