# vaibhavgaikwad03/file-encryption-and-decryption architecture

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

- Interactive diagram: https://gitdiagram.com/vaibhavgaikwad03/file-encryption-and-decryption
- Repository: https://github.com/vaibhavgaikwad03/file-encryption-and-decryption

## Overview

##### Project Type and Purpose
- The project is a desktop GUI application for encrypting and decrypting files.
- It uses the Qt framework and C++ for its implementation.
- The application’s key function is to offer a user-friendly interface for selecting files, entering a password, and performing encryption or decryption.

##### Main Components
a. GUI Layer:
- Main Window: Represented by main.cpp, which likely initializes the application and creates the main window.
- Menu and Dialogs: Several distinct dialogs are implemented (e.g., encrypt_file_dialog, decrypt_file_dialog, create_file_dialog, delete_file_dialog, write_file_dialog) and a menu page (menu_page.cpp). Each of these should be shown as separate UI components.
- Resource Management: Indicate that the project uses a Qt resource file (resources.qrc) to bundle images and other assets (images, Screenshots).

b. Business Logic and Core Functionality:
- Encryption/Decryption Logic: Encapsulated in enc_dec_logic.cpp and enc_dec_logic.h, this is where the toggling of ASCII values happens.
- Supporting Components: Files like template.cpp/h might be used for reusable components or standard patterns, so include these if they contribute to the workflow.

c. Build and Configuration:
- The CMakeLists.txt files at the top level show that the project uses CMake for configuration and building.
- Integration with external libraries, notably the Qt framework.

##### Component Relationships and Interactions
- That the main application (initialized in main.cpp) launches the menu_page.
- When a user selects an encryption or decryption operation from the menu_page, the corresponding dialog (encrypt_file_dialog or decrypt_file_dialog) is shown.
- The dialogs then interact with the enc_dec_logic component to perform the actual file transformation, with data (file paths, passwords) passed as input.
- Interactions such that the GUI components send commands/events to the logic layer and receive results/success feedback.

##### Architectural Patterns and Design Principles
- Modularity: The file-level separation (each dialog having its own .cpp/.h pair) indicates a modular approach, which should be represented with clear boundaries.

##### Relevant Technologies, Frameworks, or Libraries
- C++ for core application logic.
- Qt Framework for GUI and resource management.
- CMake for build configuration.
- Use of Qt resources for images and assets.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build and External Configuration
    subgraph "Build and External Configuration"
        buildConfig["Build & Configuration"] 
        extLib["External Libraries (Qt Framework)"]
    end

    %% Resources & Assets
    subgraph "Resources & Assets"
        resourceMgmt["Resources & Assets"]
    end

    %% GUI Layer
    subgraph "GUI Layer"
        mainApp["Main Application"]
        menuNav["Menu/Navigation"]
        encryptDialog["Encrypt File Dialog"]
        decryptDialog["Decrypt File Dialog"]
        createDialog["Create File Dialog"]
        deleteDialog["Delete File Dialog"]
        writeDialog["Write File Dialog"]
    end

    %% Business Logic
    subgraph "Business Logic"
        encryptionEngine["Encryption/Decryption Engine"]
    end

    %% Reusable Components
    subgraph "Reusable Components"
        reusableComponent["Template Support"]
    end

    %% Connections
    buildConfig -->|"builds"| mainApp
    extLib -->|"integrates"| buildConfig
    mainApp -->|"launches"| menuNav
    menuNav -->|"opens"| encryptDialog
    menuNav -->|"opens"| decryptDialog
    menuNav -->|"opens"| createDialog
    menuNav -->|"opens"| deleteDialog
    menuNav -->|"opens"| writeDialog
    mainApp -->|"loads"| resourceMgmt
    encryptDialog -->|"sendsInput"| encryptionEngine
    decryptDialog -->|"sendsInput"| encryptionEngine
    encryptionEngine -->|"returnsStatus"| encryptDialog
    encryptionEngine -->|"returnsStatus"| decryptDialog

    %% Styles
    classDef ui fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef logic fill:#A9DFBF,stroke:#196F3D,stroke-width:2px;
    classDef config fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef reusable fill:#E6B0AA,stroke:#922B21,stroke-width:2px;

    class mainApp,menuNav,encryptDialog,decryptDialog,createDialog,deleteDialog,writeDialog ui;
    class encryptionEngine logic;
    class buildConfig,extLib,resourceMgmt config;
    class reusableComponent reusable;

    %% Click Events
    click mainApp "https://github.com/vaibhavgaikwad03/file-encryption-and-decryption/blob/main/main.cpp"
    click menuNav "https://github.com/vaibhavgaikwad03/file-encryption-and-decryption/blob/main/menu_page.cpp"
    click encryptDialog "https://github.com/vaibhavgaikwad03/file-encryption-and-decryption/blob/main/encrypt_file_dialog.cpp"
    click decryptDialog "https://github.com/vaibhavgaikwad03/file-encryption-and-decryption/blob/main/decrypt_file_dialog.cpp"
    click createDialog "https://github.com/vaibhavgaikwad03/file-encryption-and-decryption/blob/main/create_file_dialog.cpp"
    click deleteDialog "https://github.com/vaibhavgaikwad03/file-encryption-and-decryption/blob/main/delete_file_dialog.cpp"
    click writeDialog "https://github.com/vaibhavgaikwad03/file-encryption-and-decryption/blob/main/write_file_dialog.cpp"
    click encryptionEngine "https://github.com/vaibhavgaikwad03/file-encryption-and-decryption/blob/main/enc_dec_logic.cpp"
    click resourceMgmt "https://github.com/vaibhavgaikwad03/file-encryption-and-decryption/blob/main/resources.qrc"
    click buildConfig "https://github.com/vaibhavgaikwad03/file-encryption-and-decryption/blob/main/CMakeLists.txt"
    click reusableComponent "https://github.com/vaibhavgaikwad03/file-encryption-and-decryption/blob/main/template.cpp"
```
