# mctzock/decryptor architecture

> Architecture diagram of the GitHub repository mctzock/decryptor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mctzock/decryptor
- Repository: https://github.com/mctzock/decryptor

## Overview

##### Project’s Purpose and Structure
- The README tells us this “Decryptor” program is designed for encrypting and decrypting arbitrary text using different algorithms. Notably, it was created for a Jugend Forscht competition.

##### And Isolate the Main Components
a. Core Engine (Decryptor/Engine):
- This component encapsulates the encryption/decryption logic.
- The “engine” package contains various algorithm implementations such as:
- AdvancedCaeser.java, Caeser.java, NewCaeser.java, PerfCaeser.java (variants of the Caesar cipher)
- Special additional functionalities seen in Animal_Choose.java, Animal_compile.java, and ShowAnimal.java.

b. Graphical User Interface (GUI):
- Located under the “gui” directory, it includes components such as:
- HomeGUI.java, Editor.java, Encrypt.java, FullScreen.java, LogoAnimation.java, and Result.java.
- This module is responsible for user interactions, displaying results, and initiating encryption/decryption processes.

c. Application Entry (Main Class):
- The Main.java file in the “main” directory is the application’s entry point.
- It coordinates the startup, wiring the GUI with the underlying engine.

d. Auxiliary Scripts and Configurations:
- Although not directly part of the Java application runtime, files such as the build script (scripts/build.bat) and configuration (_config.yml) play roles in building and deploying the project.

##### Interactions and Data Flow
- The GUI module (for instance, user actions like “Encrypt” or “Decrypt”) sends requests to the engine.
- The Engine processes the data using one of its classes (e.g., a Caesar cipher implementation), then returns the result to the GUI.
- That the Main class initializes both GUI and engine components upon starting the application.

##### Architectural Patterns and Principles
- The project follows a clean separation of concerns:
- The engine is solely responsible for encryption/decryption logic.
- The GUI handles UI responsibilities, and the Main class functions as the integration point.
- Although not explicitly an MVC (Model-View-Controller) pattern, these separations help guide how data flows between computational logic and presentation elements.

##### Relevant Technologies
- Java is the programming language.
- Any build process/tools are supported via the scripts directory, potentially recognizing Travis CI from the status badge.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Entities
    User("User"):::user

    %% GUI Module
    subgraph "Graphical User Interface"
        GUI("GUI Module"):::gui
    end

    %% Application Entry
    subgraph "Application Entry"
        Main("Application Entry (Main)"):::main
    end

    %% Decryption Engine
    subgraph "Decryption Engine"
        Engine("Decryption Engine"):::engine
    end

    %% Build & Deployment Scripts
    subgraph "Build & Deployment Scripts"
        BuildScript("Build Script"):::build
        Config("Configuration File"):::build
    end

    %% Data Flows
    User -->|"uses"| GUI
    GUI -->|"initiates"| Main
    Main -->|"coordinates"| GUI
    Main -->|"coordinates"| Engine
    GUI -->|"sendsRequest"| Engine
    Engine -->|"returnsResult"| GUI
    Main -->|"triggersBuild"| BuildScript
    Main -->|"readsConfig"| Config

    %% Click Events
    click Engine "https://github.com/mctzock/decryptor/tree/main/src/de/mctzock/decryptor/engine"
    click GUI "https://github.com/mctzock/decryptor/tree/main/src/de/mctzock/decryptor/gui"
    click Main "https://github.com/mctzock/decryptor/blob/main/src/de/mctzock/decryptor/main/Main.java"
    click BuildScript "https://github.com/mctzock/decryptor/blob/main/scripts/build.bat"
    click Config "https://github.com/mctzock/decryptor/blob/main/_config.yml"

    %% Styles
    classDef user fill:#FFEFD5,stroke:#333,stroke-width:2px;
    classDef gui fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef main fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef engine fill:#FFB6C1,stroke:#333,stroke-width:2px;
    classDef build fill:#E0FFFF,stroke:#333,stroke-width:2px;
```
