GithubHelp home page GithubHelp logo

m6sig / lorenz-cipher-sim Goto Github PK

View Code? Open in Web Editor NEW

This project forked from realgrep/lorenz-cipher-sim

2.0 0.0 0.0 59 KB

A simulator for the Lorenz Sz40 Cipher Machine written in Python

License: GNU General Public License v3.0

Python 100.00%

lorenz-cipher-sim's Introduction

A fork of https://github.com/RealGrep/lorenz-cipher-sim

Now works on Python3 with better command line interface.
Reduced numbers of LTRS/FIGS symbol to rise the bar for chosen plaintext attack to the same level as the real machine. 
Improve wheel generation speed.
Randomise wheel indicator numbers.

After consulting with the publication BREAKING TELEPRINTER CIPHERS AT BLETCHLEY PARK: An edition of I. J. Good, D. Michie and G. Timms' GENERAL REPORT ON TUNNY WITH EMPHASIS ON STATISTICAL METHODS (1945) Edited and with introductions and notes by James A. Reeds, Whitfield Diffie and J. V. Field, The python code in lorenz-sz40.py matches the cipher machine Lorenz Schlüsselzusatz 40, aka Lorenz Sz40.

Usage:
$ python3 lorenz-sz40.py [-h] [--keygen <key file>]
                         [--encrypt <input file> <key file> <output file>]
                         [--decrypt <input file> <key file> <output file>]
                         [--readtape <input file>]

optional arguments:
  -h, --help            show this help message and exit
  --keygen <key file>   Creates a random key file with normal SZ40 teeth
                        counts and sets random indicators. Edit the file to
                        suit.
  --encrypt <input file> <key file> <output file>
                        Encode ASCII plaintext to Baudot code (5 bits per
                        byte) and encrypt with wheel settings in key file,
                        writing ciphertext to output file.
  --decrypt <input file> <key file> <output file>
                        Decrypt the input file with wheel settings in key
                        file, decode from Baudot code and and output ASCII
                        plaintext to output file.
  --readtape <input file>
                        Read input file in Baudot code and display ASCII
                        equivalent.

Example:
  python3 lorenz.py --keygen <key file>
  python3 lorenz.py --encrypt <input file> <key file> <output file>
  python3 lorenz.py --decrypt <input file> <key file> <output file>
  python3 lorenz.py --readtape <input file>

lorenz-cipher-sim's People

Contributors

m6sig avatar realgrep avatar

Stargazers

alphapenng 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.