Giter VIP home page Giter VIP logo

georgyfirsov / decrypt Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 2.45 MB

My research about data encryption. The main question is: is it possible to find out a cipher by encrypted word only? I use some machine learning algorithms to classify encryption methods.

License: GNU General Public License v3.0

Python 8.25% Jupyter Notebook 91.75%
cryptography encryption-methods machine-learning research python jupyter-notebook

decrypt's Introduction

Decrypt

๐Ÿ‘‰ Note: it is just an experiment to improve my skills in machine learning and data science. It is not an accurate method for decryption. I just want to find out various regularities in words encrypted with different methods and research them.

Motivation

It is hard to decrypt a message with unknown encryption method. Main reason for this fact is following: encryption methods are developed in such a way to make you not to find out original message easily without a knowledge about encryption method used for this concrete text.

I think it is possible to make some dictionary with all the words encrypted with some method (for instance, with Caesar cipher). But having such dictionaries for almost all encryption methods means having A LOT OF SPACE on your HDD. In our time, I think, it is impossible to have such amount of disk storage.

So... This project is my attempt to avoid problems mentioned above and apply machine learning to solve this task.

Desciption

We have a kind of classification task: random encrypted word should be a member of one of 6 different classes, destinguished by encryption method:

  • Caesar cipher with shift 3
  • Caesar cipher with shift 4
  • Caesar cipher with shift 5
  • Affine cipher with multiplier 3 and shift 4
  • Affine cipher with multiplier 5 and shift 2
  • Afifne cipher with multiplier 9 and shift 11

๐Ÿ‘‰ Note: affine cipher uses following formula to calculate letter index: y = (a*x + b) mod m, where a is a multiplier, b is a shift and m is a length of original alphabet. Caesar cipher is a "subset" of affine with a = 1, formula of encrypted letter's index is following: y = (x + b) mod m.

Brief research conclusion

Classification based on some almost unique numbers for each word is impossible. Explanation: good hash functions for close arguments should give values, which are far away from each other on number line. It is a reason why all encrypted words are completely mixed in space with their hash values as a basis.

What about classification based on vectorization of words. Here we represent words as 26-dimensional vectors. For basis we use separate letters (for more information look to full research results). It is possible, because in general encrypted sets don't intersect strongly. So... It is a reason why you can successfully build build your own classifier based on vectorized words.

Credits

  • List of english words was taken from here.

decrypt's People

Contributors

georgiifirsov avatar

Watchers

 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.