A (hopefully) considerably copious collection of classical cipher crackers

Overview

ClassicalCipherCracker

A (hopefully) considerably copious collection of classical cipher crackers

Written in Python3 (and run with PyPy)

TODOs

  • Write a "text fitness evaluator" function which evaluates the likelihood that a given string of text is English
  • Write a substitution cipher decoder (which can also server as a ROT13, Caesar, and Atbash decoder)
  • Compile a list of common classical ciphers (drawing from Wikipedia and the National Cipher Competition)
  • Write a word splitter which separates plaintext into words
  • Investigate using AI to identify what cipher a ciphertext might be encrypted with

Terminology

  • Plaintext: a message which is readable and unencrypted
  • Ciphertext: a message which is encrypted
  • Decoder/Decrypter: a program which will decrypt a ciphertext when given the key
  • Cracker: a program that can decrypt a ciphertext without the key, usually by making use of the decrypter

Basic Methodology

A cracker has three major components: the key-finding algorithm, the decrypter, and the text evaluator.

The key-finding algorithm will generate keys which will be used by the decrypter to find the plaintext that the key would generate. This plaintext will be tossed into the text evaluator. If it gets a high score, the current key and plaintext will be saved as a possible answer. As more keys get tested, the best key-plaintext pair will be continuously updated.

If the keyspace is small, then every key will be tested. If brute force isn't feasible, a hill-climbing algorithm will be used, where random changes to the key are either kept or dropped if they create a better text evaluation. The goal of the algorithm is to reach a "hill", where the plaintext is as likely to be the real message as possible. Simulated annealing may also be used in the future.

Code should be written to prioritize speed when run under PyPy, though it should still be reasonably readable. In particular, decrypters must be optimized to run quickly, as they are often called thousands of times in order to crack a cipher. Different versions of decrypters should be tested and timed to determine which is most performant. The same applies to the text fitness evaluator.

Resources

Text Fitness

http://practicalcryptography.com/cryptanalysis/text-characterisation/quadgrams/
https://medium.com/analytics-vidhya/how-to-distinguish-between-gibberish-and-valid-english-text-4975078c5688
https://planetcalc.com/7959/, https://planetcalc.com/8045/
https://gitlab.com/guballa/SubstitutionBreaker/-/blob/development/subbreaker/breaker.py

Word Splitting

http://practicalcryptography.com/cryptanalysis/text-characterisation/word-statistics-fitness-measure/

Owner
Stanley Zhong
Stanley Zhong
A simple single-color identicon generator

Identicons What are identicons? Setup: git clone https://github.com/vjdad4m/identicons.git cd identicons pip3 install -r requirements.txt chmod +x

Adam Vajda 1 Oct 31, 2021
Simple but maybe too simple config management through python data classes. We use it for machine learning.

👩‍✈️ Coqpit Simple, light-weight and no dependency config handling through python data classes with to/from JSON serialization/deserialization. Curre

coqui 67 Nov 29, 2022
Shows VRML team stats of all players in your pubs

VRML Team Stat Searcher Displays Team Name, Team Rank (Worldwide), and tier of all the players in your pubs. GUI WIP: Only username search works (for

Hamish Burke 2 Dec 22, 2022
This is a library which aiming to save all my code about cpp. It will help me to code conveniently.

This is a library which aiming to save all my code about cpp. It will help me to code conveniently.

Paul Leo 21 Dec 06, 2021
Open source book about making Python packages.

Python packages Tomas Beuzen & Tiffany Timbers Python packages are a core element of the Python programming language and are how you create organized,

Python Packages 169 Jan 06, 2023
Oblique Strategies for Python

Oblique Strategies for Python

Łukasz Langa 3 Feb 17, 2022
Provides guideline on how to configure pre-commit hooks in your own python project

Pre-commit Configuration Guide The main aim of this repository is to act as a guide on how to configure the pre-commit hooks in your existing python p

Faraz Ahmed Khan 2 Mar 31, 2022
A continuation Of Project Glow By @glowstik-yt

Project Glow Greetings, I see you have stumbled upon project glow. Project glow is an open source bot worked on by many people to create a good and sa

1 Nov 17, 2021
Cash in on Expressed Barcode Tags (EBTs) from NGS Sequencing Data with Python

Cash in on Expressed Barcode Tags (EBTs) from NGS Sequencing Data with Python Cashier is a tool developed by Russell Durrett for the analysis and extr

3 Sep 11, 2022
Repo to demo translating colab/jupyter notebook to streamlit webapp

Repo to demo translating colab/jupyter notebook to streamlit webapp

Marisa Smith 2 Feb 02, 2022
An example file showing a simple endpoints like a login/logout function and maybe some others.

Flask API Example An example project showing a simple endpoints like a login/logout function and maybe some others. How to use: Open up your IDE (or u

Kevin 1 Oct 27, 2021
A repository of study materials related to Think Python 2nd Edition by Allen B. Downey. More information about the book can be found here: https://greenteapress.com/wp/think-python-2e/

Intro-To-Python This content is based on the book Think Python 2nd Edition by Allen B. Downey. More information about the book can be found here: http

Brent Eskridge 63 Jan 07, 2023
The git for the Python Story Utility Package library.

PSUP, The Python Story Utility Package Module. PSUP helps making stories or games with options, diverging paths, different endings and so on. You can

Enoki 6 Nov 27, 2022
Slimbook Battery 4 is the new version with new features that improves battery control and increases battery duration in laptops.

Slimbookbattery Slimbook Battery 4 is the new version with new features that improves battery control and increases battery duration in laptops. This

SLIMBOOK TEAM 128 Dec 28, 2022
Randomly distribute members by groups making sure that every sector is represented

Generate Groups Randomly distribute members by groups making sure that every sector is represented The Scenario Imagine that you have a large group of

Jorge Gomes 1 Oct 22, 2021
A reference implementation for processing the content.log files found at opendata.dwd.de/weather

A reference implementation for processing the content.log files found at opendata.dwd.de/weather.

Deutscher Wetterdienst (DWD) 6 Nov 26, 2022
sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character.

ꦱꦮ sawa (ꦱꦮ) is an open source programming language, an interpreter to be precise, where you can write python code using javanese character. sawa iku

Rony Lantip 307 Jan 07, 2023
An Insurance firm providing tour insurance is facing higher claim frequency

An Insurance firm providing tour insurance is facing higher claim frequency. Data is collected from the past few years. Made a model which predicts the claim status using CART, RF & ANN and compare t

1 Jan 27, 2022
Resizing using nnedi3/znedi3/nnedi3cl with center alignment and correct chroma placement

nnedi3_resample A VapourSynth script for easy resizing using nnedi3/znedi3/nnedi3cl with center alignment and correct chroma placement. Requirements n

Home Of VapourSynth Evolution 12 Sep 08, 2022
Camera track the tip of a pen to use as a drawing tablet

cablet Camera track the tip of a pen to use as a drawing tablet Setup You will need: Writing utensil with a colored tip (preferably blue or green) Bac

14 Feb 20, 2022