Skip to content

Petitoto/Enigma-Cracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enigma-Cracker

python pypy dependecies license

Enigma-Cracker is a cryptanaylsis tool for the Enigma machine

Features

Cryptanalysis:

  • Crypt / decrypt messages
  • Index of coincidence attacks
  • N-grams attacks
  • Known plaintext attack
  • Turing's bombe
  • Rejewski's attack
  • Cribs finder using wordlists
  • Ring settings recovery

Easy to use:

  • Friendly CLI
  • No external dependency
  • Export / import configurations to save your work
  • Misc commands to turn / roll back rotors, count letters...

Optimized:

  • Use generators to reduce memory consumption
  • Use multiprocessing to increase speed
  • Compatible with PyPy to get incredibly fast results

Easy to extend:

  • Customizable Enigma machines
  • Add new attacks easily

How to use

Install

git clone https://github.com/Petitoto/Enigma-Cracker
cd Enigma-Cracker
python3 enigma-cracker.py

Basic use

Use help or help <command> to get help

Global parameters are called attributes:

Enigma-Cracker > help attributes

        Attributes:
            text: text to encrypt, decrypt, or attack
            configs: Enigma configurations to encrypt, decrypt, or attack the text
            process: number of processes to launch attacks (default: 1)

        NB: multi processing prevents storing configurations as generators

Main idea behind Enigma's cryptanalysis:

  • generate a lot of possible configurations
  • use attacks to filter configurations
  • repeat attacks until the correct configuration is the only one left
  • some attacks allow separate computing of rotors, plugboard and ring settings

Demo

Help

Index of coincidence to filter random configurations

1-demo-ic.mp4

Turing's bombe and crib to recover rotors configuration and partial plugboard settings

2-demo-turing.mp4

Index of coincidence to recover more plugs

3-demo-plugs.mp4

Recover ring settings

4-demo-ring.mp4

About

Cryptanalysis tool for the Enigma machine

Topics

Resources

License

Stars

Watchers

Forks

Languages