Coder Social home page Coder Social logo

enigmaton's Introduction

Enigmaton

This is a Python encryption algorithm, loosely based on the Enigma machine I made in my spare time.

Usage

Simple direct CLI usage

To encrypt, you can simply run :

python run.py c "super secret key" "Hello world !"
# output : Pa!D;VKqDqS1q

And to decrypt :

python run.py d "super secret key" "Pa!D;VKqDqS1q"
# output : Hello world !

File usage

Alternatively, you can put the text to encrypt or decrypt in the file input.txt. If you run the same previous command but without specifying any message to encrypt, then the message will be encrypted/decrypted from input.txt to output.txt.

To encrypt :

python run.py c "super secret key"
# output : Message crypted in output file

And to decrypt :

python run.py d "super secret key"
# output : Message decrypted in output file

Rotors setting

Chosing a key only sets the initial position of the rotors. You may want to create your own rotors, which are simply a list of permutations of your alphabet. You can use the function creaRotors which creates random rotors of the correct dimensions (alternatively, you can generate them as you wish). You then have to copy and paste them in the rotors.txt file.

Why another enigma ?

Despite these techniques being very outdated, this one has small improvements : the main weakness of the Enigma was encryption and decryption were the exact same process, which implied a letter could never remain the same after encryption. The other great weakness was it was difficult to add many physical rotors, so there were usually like 3 of them, and so with big messages you could get a lot of information on the keys.

Here I got rid of these issues by removing the reflector - the operation that makes encryption the same process as decryption - and instead making decryption the reverse process, and by adding as many rotors as necessary.

enigmaton's People

Contributors

edmsg avatar

Stargazers

 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.