Giter Site home page Giter Site logo

cipher-crackers's Introduction

Cipher-Crackers

Build status

This is a collection of utilities for solving the National Cipher Challenge.

Ciphers Implemented

  • Caesar shift: Attempts every possible key and scores using quadgram statistics
  • Substitution: Uses a hill-climbing algorithm.
  • Vigenere: Guesses the key length from repeated sub-strings, then solves individual shifts using monogram statistics.
  • Columnar Transposition: Tries every key, scores using quadgrams
  • Rail-fence: Tries every key, scores using quadgrams
  • Hill Cipher: Finds the modular matrix inverse using cribs. Requires several cribs as not every crib is usable (the determinant of the matrix must be co-prime with 26).

Analysis Tools

  • Auto-spacer: Attempts to add spaces between words
  • N-Gram statistics: Occurrences of words of a specific length.
  • Cipher guesser: Uses some of the methods described here to try to identify a cipher.

Usage

Whilst this is MIT licensed, and so you're free to use this I do request that you try to avoid using this in competitions. It's far more satisfying putting the tools together yourself. If you are interested in writing your own crackers, I recommend the Practical Cryptography website, a resource that proved invaluable when writing this. This project is intended as an educational resource, not just for easy wins.

cipher-crackers's People

Contributors

squiddev avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cipher-crackers's Issues

Ciphers to Implement

  • Substitution
  • Caeser shift
  • Vigenere
  • Columnar Transposition
  • Railfence
  • Hill cipher
  • Playfair
  • Bifid

Document everything

It would be nice if we could document all the code in the main Ciphers project.

Origin of wordguesser data files?

I'm interested in writing an auto-spacer like the one included here, and I was wondering if:

https://raw.githubusercontent.com/SquidDev/Cipher-Crackers/master/src/Cipher/Analysis/AutoSpace/2WordScores.txt

and

https://raw.githubusercontent.com/SquidDev/Cipher-Crackers/master/src/Cipher/Analysis/AutoSpace/1WordScores.txt

Are under the license in the readme or if they have some other origin which means that I am allowed to use them. (I use my cipher cracker for the national cipher challenge).

Multlthread more code

We want to Multithread anything that takes more than 100ms. However this may result in having to multithread everything...

Times and currently mutlithreaded:

  • Auto spacer (400ms)
  • Cipher analysis (100ms)
  • Substitution crack (270ms)
  • Transposition crack (340ms)

Crack methods should be multithreaded and cipher analysis to.

We can probably get rid of abort as it doesn't take that long...

Multithreading

There are probably some crackers that could benefit from multi-threading:

  • Caeser: Each iteration is just a decode and then score: There is no point.
  • Transposition: Each possible key length could be run in a separate thread, or I could look into splitting the permutations into separate threads.
  • Hill Brute: Each row could be run in a separate thread
  • Rail fence: No point as this is pretty fast.
  • Substitution: Each of the 5 iterations could be run in a separate thread.
  • Vigenere: Each Caesar could be run in a separate thread, however this is pretty quick, so there is little point.

Cipher Guesser does not work

The cipher guesser's results are wrong. The text statistics work so the problem is probably somewhere in calculating the standard deviation. It might be a good thing to check that all cipher statistics are correct.

The test cases do not pass.

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.