Skip to content

Use a reference text in order to attack a cipher text with mcmc methods.

Notifications You must be signed in to change notification settings

cdevaneprugh/mcmc-cryptanalysis

Repository files navigation

cryptography via mcmc methods

The general idea is to break a cipher text using mcmc methods. I analyzed a reference text (in this case War and Peace) by counting the occurences of sequential 2 and 3 letter n-grams in the text. These counts are stored in a dictionary which is then used to score the cipher text as decryption keys are tried out. We start with a completely random decryption key, score the cipher text, then propose a new decryption key by randomly swapping one of the letters. We score the cipher text as decypted by the new key, and accept or reject the proposal with a given probability. The idea is that the decryption key will improve as the score improves, ideally getting us all the way to a fully decrypted cipher text. This is similar to the famous "traveling salesman" problem. See the write up for more details.

About

Use a reference text in order to attack a cipher text with mcmc methods.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages