Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shreyansh26/solving-substitution-ciphers-using-mcmc
Solving substitution ciphers using Markov Chain Monte Carlo (MCMC)
https://github.com/shreyansh26/solving-substitution-ciphers-using-mcmc
cryptography mcmc probability sampling-methods substitution-cipher
Last synced: 5 days ago
JSON representation
Solving substitution ciphers using Markov Chain Monte Carlo (MCMC)
- Host: GitHub
- URL: https://github.com/shreyansh26/solving-substitution-ciphers-using-mcmc
- Owner: shreyansh26
- Created: 2023-07-22T17:46:29.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-22T17:46:59.000Z (over 1 year ago)
- Last Synced: 2024-04-16T03:52:37.428Z (7 months ago)
- Topics: cryptography, mcmc, probability, sampling-methods, substitution-cipher
- Language: Python
- Homepage: https://shreyansh26.github.io/post/2023-07-22_solving_substitution_cipher_using_mcmc/
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Solving Substitution Ciphers using Markov Chain Monte Carlo (MCMC)
I have written about the explanation of the algorithm and the code in this [blog post](https://shreyansh26.github.io/post/2023-07-22_solving_substitution_cipher_using_mcmc/).
* [prep_freq_counts.py](prep_freq_counts.py) - Bigram frequency/probability calculation
* [solve_cipher.py](solve_cipher.py) - Solve the substitution cipher given in [ciphertext.txt](ciphertext.txt) using MCMC and compare it with the plaintext given in [plaintext.txt](plaintext.txt).## To run
```bash
pip install -r requirements.txt
python prep_freq_counts.py
python solve_cipher.py
```