# myfunc/cryptoanalizer architecture

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

- Interactive diagram: https://gitdiagram.com/myfunc/cryptoanalizer
- Repository: https://github.com/myfunc/cryptoanalizer

## Overview

##### Project Type and Purpose
- This is a multi-project solution with a focus on cryptography and analysis. It comprises desktop (WPF) applications that serve specific roles in generating cryptographic components.
- The README indicates three main components: Mironov.Golomba (a Galois register generator with Golomba verification), Mironov.Walsh.Friendly (Walsh-Adamara Matrix Generator), and Mironov.EuclidGenerator (a bit vector generator for Walsh-like systems).
- There are also supporting or test projects (e.g., Mironov.ConsoleTest, Mironov.Crypto, Mironov.Crypto.View, etc.) which likely contain shared libraries, utilities, or unit tests.

##### File Structure Analysis
- The repository contains many projects. At the top level, you have solution files (Mironov.Golomba.sln) and several directories named after individual applications.
- Each project (e.g., Mironov.Golomba, Mironov.Walsh, Mironov.EuclidGenerator, etc.) houses a typical WPF structure: App.xaml and MainWindow.xaml, along with related configuration files and code-behind.
- The “Mironov.Crypto” folder holds cryptographic-related logic (constants, polynomials, utilities, Walsh matrix utilities) which are shared across projects.
- The “Mironov.Crypto.View” directory contains additional WPF elements (custom controls such as GroupListBox, HamingListBox, etc.) that are probably used across the user interface of these tools.
- Additional directories (tests, console projects) indicate unit testing and command-line-based experimentation.

a. Main components:
- Frontend/UI Layer: Multiple WPF-based projects (Mironov.Golomba, Mironov.Walsh, Mironov.Walsh16, Mironov.EuclidGenerator, Mironov.Golomba.ViewUtil, etc.). They represent the interactive parts of the system.
- Business Logic / Core Cryptographic Engine: The Mironov.Crypto project and its subdirectories (Consts, Polynom, Utils, Walsh) encapsulate the essential algorithms (e.g., polynomial handling, matrix processing, register generation).
- Supporting and Testing Components: Projects like Mironov.ConsoleTest and Mironov.GolombaTests wrap around core functionality for testing, demos, or additional logic.
- Configuration and Resources: Configuration files (App.config, App.xaml) across each project which define resources, settings, and the overall behavior of the WPF applications.

b. Relationships and Interactions:
- How projects such as Mironov.Golomba, Mironov.Walsh, and Mironov.EuclidGenerator derive their core functionality from the shared cryptography libraries.
- How test projects interact with the core logic for validation and automated testing.
- Configuration files feeding into the applications, and mention shared utilities that support functionality (like those in Mironov.Crypto/Utils).

c. Important Architectural Patterns and Design Principles:
- The solution follows a modular approach – splitting responsibilities between UI elements (presentation) and cryptographic processing (business logic).
- The use of shared libraries (Mironov.Crypto) promotes code reuse and separation of concerns.
- Testing projects ensure that a unit testing framework is integrated within the overall design.

d. Relevant Technologies, Frameworks, and Libraries:
- WPF for rich desktop UI development.
- .NET Framework (or possibly .NET Core/Standard depending on the version used) as the underlying technology.
- Specific cryptographic logic implemented in the Mironov.Crypto layer (no external third-party libraries are immediately apparent, but internal modules like “Walsh” and “Polynom” indicate specialized code).
- Configuration through App.config and resources through embedded resource files.

##### Important Elements
- Use clear labels for each module/component (e.g., “UI - Mironov.Golomba”, “Cryptographic Engine - Mironov.Crypto”, “UI - Mironov.Walsh”, etc.).
- Rectangles for UI components.

## Diagram (Mermaid)

```mermaid
flowchart TB
  %% Presentation Layer
  subgraph "Presentation Layer"
    UI_Golomba["UI - Mironov.Golomba"] 
    UI_Walsh["UI - Mironov.Walsh.Friendly"]
    UI_Euclid["UI - Mironov.EuclidGenerator"]
  end

  %% Business Logic Layer
  subgraph "Business Logic Layer"
    Crypto["Core Cryptographic Engine - Mironov.Crypto"]
    CryptoView["Shared Crypto UI Components - Mironov.Crypto.View"]
  end

  %% Supporting/Testing Layer
  subgraph "Supporting/Testing Layer"
    ConsoleTest["Console Test - Mironov.ConsoleTest"]
    UnitTests["Unit Tests - Mironov.GolombaTests"]
  end

  %% Data Flow
  UI_Golomba -->|"Uses core crypto logic"| Crypto
  UI_Walsh -->|"Uses core crypto logic"| Crypto
  UI_Euclid -->|"Uses core crypto logic"| Crypto

  UI_Golomba -->|"Integrates custom controls"| CryptoView
  UI_Walsh -->|"Integrates custom controls"| CryptoView
  UI_Euclid -->|"Integrates custom controls"| CryptoView

  ConsoleTest -->|"Tests crypto operations"| Crypto
  UnitTests -->|"Validate Galois methods"| Crypto

  %% Legend
  subgraph Legend [Legend]
    L_UI["UI Layer: Blue Rectangles"]
    L_Crypto["Crypto Engine: Green Rectangles"]
    L_Shared["Shared UI Components: Purple Rectangles"]
    L_Tests["Testing: Yellow Rectangles"]
  end

  %% Class Definitions
  classDef ui fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
  classDef crypto fill:#A9DFBF,stroke:#145A32,stroke-width:2px;
  classDef shared fill:#D7BDE2,stroke:#6C3483,stroke-width:2px;
  classDef tests fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
  classDef legend fill:#ffffff,stroke:#333,stroke-dasharray: 5 5;

  class UI_Golomba,UI_Walsh,UI_Euclid ui;
  class Crypto crypto;
  class CryptoView shared;
  class ConsoleTest,UnitTests tests;
  class L_UI,L_Crypto,L_Shared,L_Tests legend;

  %% Click Events for Component Mapping
  click UI_Golomba "https://github.com/myfunc/cryptoanalizer/tree/master/Mironov.Golomba/" "UI – Galois Register Generator"
  click UI_Walsh "https://github.com/myfunc/cryptoanalizer/blob/master/Mironov.Walsh.Generator/Mironov.Walsh.Friendly.csproj" "UI – Walsh-Adamara Matrix Generator"
  click UI_Euclid "https://github.com/myfunc/cryptoanalizer/tree/master/Mironov.EuclidGenerator/" "UI – Bit Vector Generator for Walsh-like systems"
  click Crypto "https://github.com/myfunc/cryptoanalizer/tree/master/Mironov.Crypto/" "Core Cryptographic Engine"
  click CryptoView "https://github.com/myfunc/cryptoanalizer/tree/master/Mironov.Crypto.View/" "Shared Cryptographic UI Components"
  click ConsoleTest "https://github.com/myfunc/cryptoanalizer/tree/master/Mironov.ConsoleTest/" "Console Test"
  click UnitTests "https://github.com/myfunc/cryptoanalizer/tree/master/Mironov.GolombaTests/" "Unit Tests for Galois and cryptography"
```
