Skip to main content

Python byte-enabled Enigma-like simulation.

Project description

Enigma Byte Machine === Using the same principles that my ‘classic’ Enigma simulation is built on; I reverse-engineered a newer, stronger, more robust Enigma encryption scheme that is capable of encoding any standard 8-bit character (also known as a byte). By removing the 26 character limitation, we are now able to encrypt entire binary files using the same basic mechanics as the original Enigma machine.

Technical Details

  • Developed and tested on Python 3.6.1 for Windows.
    • support for other python versions (>= 3.6.0) and other operating systems is likely, but not guaranteed.
  • Designed to be invoked as a module, but can be run from the script just as well.
  • Can be imported and used in your own applications, but no documentation is provided yet (though it shouldn’t be too hard to figure out).
  • Requires requests module and internet connection to correctly build readme (conversion from Markdown to reStructuredText).


This package is now available on PyPI, and may be installed using pip install bitnigma or directly from the repo using pip install git+git://


usage: python -m bitnigma [-h] [--plugboard PLUGBOARD [PLUGBOARD ...]]
                   [--rotors ROTORS [ROTORS ...]] [--reflector REFLECTOR]
                   [--state STATE] [--state-create] [--state-update]
                   [--state-print] [--state-seed STATE_SEED]
                   [--state-seed-file STATE_SEED_FILE] [--input INPUT]
                   [--input-std] [--input-path INPUT_PATH] [--output-std]
                   [--output-path OUTPUT_PATH] [--chunk-size CHUNK_SIZE]
                   [--benchmark] [--progress]

Process some data through a simulated Enigma machine

optional arguments:
  -h, --help            show this help message and exit
                        Specify a list of byte pairings for the plugboard. ex;
                        10:25 50:77 102:33
  --rotors ROTORS [ROTORS ...], -ro ROTORS [ROTORS ...]
                        Specify a list of rotors in the following format:
                        SHORTNAME[:SETTING] ex; byte1:52
  --reflector REFLECTOR, -rf REFLECTOR
                        Specify a reflector by its shortname.
  --state STATE, -s STATE
                        Path for the state file (reading or writing). States
                        can be used in lieu of manually specifying rotors and
                        reflectors every time.
  --state-create, -sc   Take the plugboard, rotor, and reflector args and save
                        them to the state file (and then exit).
  --state-update, -su   After processing, save the changed rotor state back to
                        the state file. This allows for a continuous rotor
                        progression over multiple program invocations. THERE
                        IS NO ROLLBACK, SO BACK UP THE STATE.
  --state-print, -sp    Print the state information to stdout and then exit.
  --state-seed STATE_SEED, -ss STATE_SEED
                        String seed for to create a randomly generated state.
  --state-seed-file STATE_SEED_FILE, -ssf STATE_SEED_FILE
                        File to use as seed for a randomly generated state.
  --input INPUT, -i INPUT
                        Input a string via this command line argument.
  --input-std, -is      Read data from stdin pipe.
  --input-path INPUT_PATH, -ip INPUT_PATH
                        Open and read data from file path.
  --output-std, -os     Write output to the stdout pipe.
  --output-path OUTPUT_PATH, -op OUTPUT_PATH
                        Write output to the specified file path.
  --chunk-size CHUNK_SIZE, -c CHUNK_SIZE
                        Chunk size for reading and writing data.
  --benchmark, -b       Benchmark the processing time (prints results to
  --progress, -p        Show the progress meter; written to stderr.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for bitnigma, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size bitnigma-1.1.0-py3-none-any.whl (18.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size bitnigma-1.1.0.tar.gz (13.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page