Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jesseemond/break-substitution-cipher
Break substitution cipher using stochastic optimization
https://github.com/jesseemond/break-substitution-cipher
Last synced: about 17 hours ago
JSON representation
Break substitution cipher using stochastic optimization
- Host: GitHub
- URL: https://github.com/jesseemond/break-substitution-cipher
- Owner: JesseEmond
- Created: 2021-03-07T19:03:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-03-07T19:03:19.000Z (over 3 years ago)
- Last Synced: 2024-10-11T20:36:33.364Z (about 1 month ago)
- Language: C++
- Size: 1.24 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Implementation based on
http://practicalcryptography.com/cryptanalysis/text-characterisation/quadgrams/#a-python-implementation
https://planetcalc.com/8045/English quadgram frequencies from:
http://practicalcryptography.com/cryptanalysis/letter-frequencies-various-languages/english-letter-frequencies/- First implemented in Python (`solve.py`), got ~6,350 attempts/s
- Re-implemented in C++ (`main.cpp`) (representing ngram log-probs as `unordered_map`), got ~39,700 attempts/s
- Represented n-grams as ints (`WXYZ -> W*26^3 + X*26^2 + Y*26 + Z`), got ~69,000 attempts/s
- Represented n-gram log-probs in a fixed array (of size `26^4`) got **~735,000** attempts/s
- Re-used plaintext string when decrypting, got **~950,000** attempts/s.