Code Monkey home page Code Monkey logo

blasto's Introduction

Blasto

A Python implementation of Hill-Climbing for cracking classic ciphers.

Blasto currently supports following ciphers :

  • Substitution cipher (includes Caesar Shift, Affine, etc...)
  • Turning Grille cipher

It also supports following languages used for plaintext scoring :

  • English
  • German
  • Spanish

*Quadgram statistics for the above languages are generated from practicalcryptography.com and compressed using pyminifier.

Installation

To install Blasto, clone this repository and run python setup.py install

Usage

usage: blasto [options]

optional arguments:
  -h, --help           show this help message and exit
  -i FILE              Input ciphertext from file. If not defined, ciphertext
                       will be inputed manually
  -o FILE              Save output result to file
  --cipher CIPHERTYPE  Set cipher type. If not defined, it will be prompted to
                       select manually. Available: (subs, grille)
  -s SEC, --sleep SEC  Set interval time between iterations to avoid max CPU
                       usage (0 to none). (Default=0.0001)
  -c NUM, --count NUM  Set iterations. (Default=1000)
  -l LANGUAGE          Set Plaintext language for Quadgram statistic.
                       Available: (en, es, de). (Default=en)

Example

Running with default options.

~$ blasto

1. Substitution Cipher
2. Turning Grille Cipher

Select Cipher Type : 1
Enter ciphertext : HSJFHSJCNSKAFKAFJLAGKAL

Running with ciphertext from a file, use specified cipher and save final plaintext to a file.

~$ blasto --cipher=subs -i cipher.txt -o plain.txt

Running with 10000 count per iterations and using German language based plaintext.

~$ blasto --count=10000 -l de

About Hill-Climbing

In computer science, hill climbing is a mathematical optimization technique which belongs to the family of local search. It is an iterative algorithm that starts with an arbitrary solution to a problem, then attempts to find a better solution by incrementally changing a single element of the solution. If the change produces a better solution, an incremental change is made to the new solution, repeating until no further improvements can be found...

(https://en.wikipedia.org/wiki/Hill_climbing)

blasto's People

Contributors

merricx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

blasto's Issues

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.