Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Phase 3
Browse files Browse the repository at this point in the history
  • Loading branch information
varunsingh87 committed Nov 27, 2023
2 parents b8f9050 + 930ef91 commit 8310f6b
Show file tree
Hide file tree
Showing 37 changed files with 2,005 additions and 939 deletions.
57 changes: 57 additions & 0 deletions .fleet/run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"configurations": [
{
"name": "Main Build",
"type": "jps-build",
"workingDir": "$PROJECT_DIR$",
"module": "com.varunsingh.frequencyanalysissimulator",
"includeTests": false,
},
{
"name": "Main",
"type": "jps-run",
"workingDir": "$PROJECT_DIR$",
"dependsOn": [
"Main Build"
],
"mainClass": "frequencyanalysissimulator.presentation.main.Main",
"module": "com.varunsingh.frequencyanalysissimulator",
"options": [
"-Dfile.encoding=UTF-8",
"-Dsun.stdout.encoding=UTF-8",
"-Dsun.stderr.encoding=UTF-8"
],
},
{
"name": "Data Collection Tool Build",
"type": "jps-build",
"workingDir": "$PROJECT_DIR$",
"module": "com.varunsingh.frequencyanalysissimulator",
"includeTests": false,
},

{
"name": "Data Collection Tool",
"type": "jps-run",
"workingDir": "$PROJECT_DIR$",
"dependsOn": [
"Data Collection Tool Build"
],
"mainClass": "dataanalysis.DataPopulater",
"module": "com.varunsingh.frequencyanalysissimulator",
"options": [
"-Dfile.encoding=UTF-8",
"-Dsun.stdout.encoding=UTF-8",
"-Dsun.stderr.encoding=UTF-8"
],
"args": [
"all"
]
},
{
"type": "maven",
"name": "Full Test Suite",
"tasks": ["test"],
}
]
}
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ optimal algorithm and conditions of decrypting a Vigenere cipher.
* Kasiski Examination
* Freidman Test
* Kerckhoff's Method
<<<<<<< HEAD
* Dictionary attack using WordNet API
=======
* Dictionary attack using Words and WordNet API
>>>>>>> 930ef91784de248ecdf0fac7deb03a4ec249b82c
## Usage

Expand Down Expand Up @@ -56,8 +60,11 @@ the `jpackage` utility from the Java Development Kit:
**: `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*

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

=======
>>>>>>> 930ef91784de248ecdf0fac7deb03a4ec249b82c
## Process

**Phase I: Monoalphabetic Ciphers**: July 22, 2019 - February 16, 2020
Expand All @@ -68,12 +75,15 @@ Do the same for any other Java class with a main method that you would like to t

### Phase III

<<<<<<< HEAD
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](https://github.com/varunsingh87/Frequency-Analysis-Simulator/releases/tag/v3.0.0) 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.

=======
>>>>>>> 930ef91784de248ecdf0fac7deb03a4ec249b82c
* Data GUI
* Data collection GUI
* Variants of Vigenere cipher
Expand All @@ -92,7 +102,11 @@ encrypted with the Vigenere cipher.

* Advanced Data Structures - Java Collections API, including TreeSet, HashMap, ArrayList
* Layered Architecture - separated into presentation code (Java Swing framework), business logic (pure Java), and data
<<<<<<< HEAD
analysis module (I/O Streams)
=======
analysis module (pure Java I/O)
>>>>>>> 930ef91784de248ecdf0fac7deb03a4ec249b82c
* Recursion

## Built With
Expand Down
Binary file added assets/icon.icns
Binary file not shown.
Binary file modified assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
181 changes: 99 additions & 82 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,87 +1,104 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>com.varunsingh.frequencyanalysissimulator</artifactId>
<groupId>com.varunsingh</groupId>
<modelVersion>4.0.0</modelVersion>
<version>1.00</version>
<url>https://varunsingh87.github.io/frequency-analysis-simulator</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>19</maven.compiler.source>
<maven.compiler.release>19</maven.compiler.release>
</properties>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>com.varunsingh.frequencyanalysissimulator</artifactId>
<groupId>com.varunsingh</groupId>
<modelVersion>4.0.0</modelVersion> <!-- Because we are in Maven major version 3 -->
<version>1.00</version>
<url>https://varunsingh87.github.io/frequency-analysis-simulator</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>19</maven.compiler.source>
<maven.compiler.release>19</maven.compiler.release>
<exec.mainClass>frequencyanalysissimulator.presentation.main.Main</exec.mainClass>
</properties>

<distributionManagement>
<site>
<id>website</id>
<url>scm:git:git@github.com/varunsingh87/Frequency-Analysis-Simulator.git</url>
</site>
</distributionManagement>
<distributionManagement>
<site>
<id>website</id>
<url>scm:git:git@github.com/varunsingh87/Frequency-Analysis-Simulator.git</url>
</site>
</distributionManagement>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<defaultGoal>mvn compile exec:java -Dexec.mainClass="frequencyanalysissimulator.presentation.main.Main"</defaultGoal>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.0</version>
<scope>test</scope> <!-- Not packaged in JAR file because it is used for tests only, used for mvn test -->
</dependency>
</dependencies>

<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/generated</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>19</source>
<target>19</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<scmBranch>gh-pages</scmBranch>
</configuration>
</plugin>
</plugins>
</build>
<build>
<defaultGoal>mvn compile exec:java -Dexec.mainClass="frequencyanalysissimulator.presentation.main.Main"
</defaultGoal>

<plugins> <!-- Automate Maven lifecycle phases -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/generated</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <!-- Compiles java files (javac) with mvn compiler:compile (class files go to target folder) -->
<!-- mvn compiler:testCompile for compiling test classes-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>20</source> <!-- Configuration for latest version - Java 20 -->
<target>20</target>
</configuration>
</plugin>
<plugin> <!-- Run unit tests and generate reports -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<scmBranch>gh-pages</scmBranch>
</configuration>
</plugin>
<plugin> <!-- Build an executable JAR by adding a META-INF/MANIFEST.MF file -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>frequencyanalysissimulator.presentation.main.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>

<developers>
<developer>
<name>Varun Singh</name>
</developer>
</developers>
</project>
28 changes: 28 additions & 0 deletions src/main/java/core/CipherInputBox.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package core;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;

public class CipherInputBox extends JScrollPane {
private final JTextArea textArea;

public CipherInputBox() {
super(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
textArea = new JTextArea();
textArea.setMinimumSize(new Dimension(10, 10));
textArea.setOpaque(false);
textArea.setLineWrap(true);
textArea.setBorder(new EmptyBorder(10, 10, 10, 10));
textArea.setFont(new Font("Segoe Script", Font.BOLD, 20));
textArea.setForeground(Color.BLUE);
textArea.setToolTipText("Ciphertext or plaintext");
setViewportView(textArea);

setOpaque(false);
}

public JTextArea getTextArea() {
return textArea;
}
}
Loading

0 comments on commit 8310f6b

Please sign in to comment.