View on GitHub

Frequency-Analysis-Simulator

A Java program that decrypts cryptograms without keys using frequency analysis

Frequency Analysis Simulator

The purpose of this project is to decrypt a monoalphabetic substitution cipher using frequency analysis and find the optimal algorithm and conditions of decrypting a Vigenere cipher.

Methods of Cryptanalysis

Usage

  1. Clone this repo with git clone https://github.com/varunsingh87/Frequency-Analysis-Simulator (for help see the GitHub documentation).
  2. Run mvn package
  3. Run the GUI with the following command:
mvn compile exec:java"

Collecting Data

Run the following command for data collection of a single input (~480 runs/data points):

mvn compile exec:java -Dexec.mainClass="dataanalysis.DataCollector"

Run the following command for data population of experiment data. To use a different key you will need to edit the default in DataCollector.java and make a new folder and subfolders of all the combinations of key length and caesar decryption algorithms in the following format:

outputs/
[ioc, friedman]_[kasiski, kerckhoff]/

Generate executable file

To create an executable file without the user needing the Java Runtime Environment on his or her computer, use the jpackage utility from the Java Development Kit:

**Mac **: jpackage --input target/ --name 'Frequency Analysis Simulation' --main-jar com.varunsingh.frequencyanalysissimulator-1.00.jar --main-class frequencyanalysissimulator.presentation.main.Main --type dmg --icon ./assets/icon.icns

*Windows **: jpackage --input target/ --name 'Frequency Analysis Simulation' --main-jar com.varunsingh.frequencyanalysissimulator-1.00.jar --main-class frequencyanalysissimulator.presentation.main.Main --type exe --icon ./assets/icon.ico *Does not work on Mac

*Linux **: jpackage --input target/ --name 'Frequency Analysis Simulation' --main-jar com.varunsingh.frequencyanalysissimulator-1.00.jar --main-class frequencyanalysissimulator.presentation.main.Main --type deb --icon ./assets/icon.ico *Does not work on Mac

Do the same for any other Java class with a main method that you would like to turn into an executable file.

Process

Phase I: Monoalphabetic Ciphers: July 22, 2019 - February 16, 2020

Phase II: Vigenere Ciphers: September 26, 2022 - May 8, 2023

Phase III: Graphics, Refactors, Variants: July 22, 2023 - November 26, 2023

Phase III

The purpose of phase III was to study classical ciphers further and implement GUIs to reduce the project’s reliance on Google Sheets for data visualization and analysis. The data analysis module in Version 3 contains two GUIs that allow a user to collect and visualize the accuracy of the Vigenere decryption algorithms with a particular message when encrypted with the Vigenere cipher.

Phase II

Phase I

Concepts Used

Built With

Sources of Research