Giter Club home page Giter Club logo

enigma-1's Introduction

ENIGMA

This is a small application written in python which simulates both the M3 and M4, 3 and 4 rotor variants of the Enigma machine which was utilised by German forces during WWII to encode information.

Included are two scripts for a quick demo of each: enigmaM3_test.py and enigmaM4_test.py which have preset keys and rotor selection.

Custom Machine

To create a new instance of Enigma the default can be used which is an M3 instance with pre-selected rotor arrangement and reflector choice, or all settings can be chosen by the user. Note as with the machine itself, one of the 8 numbered rotor types may only be selected once:

my_rotor_list = [1,4,6,3]     # 3 or 4 of 1,2,3,4,5,6,7,8
my_reflector  = 'B'           # 'B' or 'C'
machine_type  = 'M4'          # 'M3' or 'M4' (should match rotor list)
debug_level   = 'ERROR'       # 'ERROR', 'INFO', 'DEBUG' (see python 'logging' module documentation)

enigma = enigma.Enigma( rotor_list     = my_rotor_list ,
                        user_reflector = my_reflector  ,
                        enigma_type    = machine_type  ,
                        debug          = debug_level)

enigma.setkey('NERO')
enigma.type_phrase('NOBODYEXPECTSTHESPANISHINQUISITION')

enigma-1's People

Contributors

artemis-beta avatar natfarleydev avatar

Watchers

James Cloos avatar  avatar

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.