Python Enigma cypher machine simulator.
Project description
pyEnigma
pyEnigma, a Python Enigma cypher machine simulator.
Installation
$ sudo pip install pyenigma
Usage
As a Python module:
Python 3.5.2 (default, Oct 20 2016, 10:10:10)
[GCC 6.2.0 20161005] 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
>>>
>>> engr = 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(engr)
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
>>> res = engr.encipher("Hello World")
>>> print res
Qgqop Vwoxn
Command line:
$ echo "Hello World" | enigma ABC A I II III "AV BS CG DL FU HZ IN KM OW RX"
Qgqop Vwoxn
$ echo "Qgqop Vwoxn" | enigma ABC A I II III "AV BS CG DL FU HZ IN KM OW RX"
Hello World
License
pyEnigma is under GPLv3 license.
Release History
0.1 (2017-03-15)
first release on pypi.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyEnigma-0.1.tar.gz
(18.9 kB
view details)
File details
Details for the file pyEnigma-0.1.tar.gz.
File metadata
- Download URL: pyEnigma-0.1.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c10c1dfc768ad0532e7586375baa8eae4c70266556c3c5bec98bf296961ee7a2
|
|
| MD5 |
6ea31e279f349b80b0b40b06cdcde0df
|
|
| BLAKE2b-256 |
e359250d017970d0da75331553a8ffb6720e370b19dde5ea018a0a14fa5dcea9
|