GithubHelp home page GithubHelp logo

zadammac / python-enigma Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 5.0 56 KB

A simple module which adds Enigma Machine-emulating functionality to your python projects. A pypi release is forthcoming.

Home Page: https://www.arcanalabs.ca

License: Apache License 2.0

Python 100.00%
enigma-machine python3

python-enigma's People

Contributors

barrowsys avatar zadammac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

python-enigma's Issues

thread Safe

hello,

is this package thread safe ?
I get error when running multiple machin in thread

Incorrect output with certain settings

There appears to be an issue with some combinations of rotors.
For example the code below gives the output as ECPRX LNMBQ.

from python_enigma import enigma
ciphertext = "HELLO WORLD"
plugs="AS LK DE FV GJ CU MW OT PX RZ" 
rotors = [("II", "A"), ("IV", "B"), ("III", "C")] 
machine = enigma.Enigma(catalog="default", stecker=plugs,
                    rotors=rotors, reflector="Reflector B", operator=True, word_length=5, stator="military")
machine.set_wheels("EFC")
plain=machine.parse(ciphertext)
print(plain)

Whereas if you run it through other tools you get an output of CVHFJ PBKYK.

This is using python3. Am I doing something wrong?

catalogue.json not found in the module

where is the catatague.json that is supposed to be in the module ?
i can not instanciate object enigma because is not there

i installed python-enigma with pip

Could you provide some code example ?

[BUG] Module May not Be M4/Enigma Compliant

Describe the bug
User Michael Zimmermann [email protected] reported that he was having trouble decrypting a known-plaintext message generated on an original Enigma M4. This message was originally produced during the war and is fully decryptable using other emulation platforms.

To Reproduce
Steps to reproduce the behavior:

  1. Create an enigma machine instance with the appropriate settings (detailed below)
  2. Set the wheelpack correctly.
  3. Parse the encrypted message.
  4. If reproducing, the wrong plaintext is sent.

Expected behavior
A new key should be generated and written to configuration, and that key should be used throughout the rest of the backup process.

Log/Console Output
Where possible, add the output of the Logs or Console when the problem occurs.

Desktop (please complete the following information):

  • Not obtained. There's nothing platform-specific in this machine so... shouldn't matter.

Additional context
Add any other context about the problem here.

Reflector: C
Greek: B
Wheels: 568
Wheel positions: YOSZ
Rings: AAEL
Plugs: AE BF CM DQ HU JN LX PR SZ VW

Message indicator groups: DUHF TETO

Ciphertext (without indicator groups):
LANOTCTOUARBBFPMHPHGCZXTDYGAHGUFXGEWKBLKGJWLQXXTGPJJAVTOYJFGSLPPQIHZFXOEBWIIEKFZLCLOAQJULJOYHSSMBBGWHZANVOIIPYRBRTDJQDJJOQKCXWDNBBTYVXLYTAPGVEATXSONPNYNQFUDBBHHVWEPYEYDOHNLXKZDNWRHDUWUJUMWWVIIWZXIVIUQDRHYMNCYEFUAPNHOTKHKGDNPSAKNUAGHJZSMJBMHVTREQEDGXHLZWIFUSKDQVELNMIMITHBHDBWVHDFYHJOQIHORTDJDBWXEMEAYXGYQXOHFDMYUXXNOJAZRSGHPLWMLRECWWUTLRTTVLBHYOORGLGOWUXNXHMHYFAACQEKTHSJW

Plaintext:

KRKRALLEXXFOLGENDESISTSOFORTBEKANNTZUGEBENXXICHHABEFOLGENDENBEFEHLERHALTENXXJANSTERLEDESBISHERIGXNREICHSMARSCHALLSJGOERINGJSETZTDERFUEHRERSIEYHVRRGRZSSADMIRALYALSSEINENNACHFOLGEREINXSCHRIFTLSCHEVOLLMACHTUNTERWEGSXABSOFORTSOLLENSIESAEMTLICHEMASSNAHMENVERFUEGENYDIESICHAUSDERGEGENWAERTIGENLAGEERGEBENXGEZXREICHSLEITEIKKTULPEKKJBORMANNJXXOBXDXMMMDURNHFKSTXKOMXADMXUUUBOOIEXKP

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.