# siddharthbhamare01/secure-file-store-using-hybridcryptography architecture

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

- Interactive diagram: https://gitdiagram.com/siddharthbhamare01/secure-file-store-using-hybridcryptography
- Repository: https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography

## Overview

##### Project Type and Purpose
- The project is a Python-based cryptographic application that implements hybrid encryption/decryption techniques.
- It appears to combine back-end cryptographic functionalities (via Encrypt.py, Decrypt.py, IVsKeys.py, Threads.py, Main.py, dataProcessing.py) with a web front-end interface (indicated by app.py, the “templates” directory with multiple HTML files, and the “static” folder for images).
- In essence, the project handles reading and writing from text files such as Original.txt and Output.txt and uses an “Infos” folder to store keys, IVs, and a log, which supports its cryptography operations.

##### Analyzing the File Structure
- Core Cryptography Components:
- Encrypt.py and Decrypt.py: Modules for encryption and decryption.
- IVsKeys.py: Likely responsible for generating or managing initialization vectors and keys.
- Threads.py: May be used to handle multithreading (for parallel encryption/decryption tasks perhaps).
- Data and Configuration:
- Original.txt and Output.txt: Input and output data files.
- Infos directory: Contains key files (KEY1.txt, KEY2.txt), IV.txt (initialization vector), and a log file (Log.txt).
- dataProcessing.py: Possibly handles pre-/post-processing of data before/after encryption.
- User Interface and Web Components:
- app.py: Likely the entry point for the web server.
- templates and static directories: Used to serve web pages and assets (images, HTML templates such as IndexE.html, Option.html, etc.).
- Other:
- Main.py might be used to trigger a command-line version, or to integrate different pieces.

a. Main Components:
- User Interface Layer:
- “app.py” as the web server/controller.
- “templates” (views) and “static” files (assets) as resources.
- Cryptography Engine:
- Encrypt.py, Decrypt.py, and IVsKeys.py as the core cryptographic modules.
- Threads.py as a helper module for concurrently processing tasks.
- Data Processing & File I/O:
- dataProcessing.py, Original.txt, and Output.txt should be clearly noted as input/output and processing modules.
- Data/Key Store:
- The Infos directory (with its key and log files) acts as the configuration and persistent data store for security parameters.
- Orchestration:
- Main.py may coordinate the overall flow when the project is run outside or in addition to the web interface.

b. Relationships and Interactions:
- The UI layer (app.py) communicates with the cryptography engine to send data (from user input or file uploads) and retrieve results.
- The engine receives commands to either encrypt or decrypt data, calling the respective Encrypt.py or Decrypt.py.
- IVsKeys.py provides necessary key/IV data (possibly loaded from and saved to the Infos directory).
- dataProcessing.py acts as an intermediary to format, validate, or log data throughout processing.
- Threads.py possibly improves performance by managing asynchronous processing of cryptographic operations.
- All modules are connected through file I/O for reading/writing plaintext (Original.txt) and results (Output.txt).

c. Architectural Patterns and Design Principles:
- Separation of Concerns: Different modules focus on UI, cryptography, and data handling.
- MVC-esque Separation (in the web portion): “app.py” acts as the controller; “templates” serve view logic; and back-end modules (Encrypt.py, Decrypt.py, etc.) act as the model.
- Modularity and Single Responsibility: Each file focuses on a distinct task—whether key management, encryption, decryption, data processing, or threading.

d. Relevant Technologies and Frameworks:
- Python is the primary language.
- Possibly Flask (or a similar framework) for the web interface (indicated by app.py, templates, and static directories).
- Standard Python modules for threading and file I/O.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface Layer
    subgraph "User Interface Layer"
        UI["Web Server (app.py)"]:::ui
        T["Templates (HTML)"]:::ui
        S["Static Assets (static/)"]:::ui
        SI["Images (static/img)"]:::ui
    end

    %% Cryptography Engine
    subgraph "Cryptography Engine"
        E["Encryption Module (Encrypt.py)"]:::engine
        D["Decryption Module (Decrypt.py)"]:::engine
        K["Key/IV Manager (IVsKeys.py)"]:::engine
        TH["Thread Manager (Threads.py)"]:::engine
    end

    %% Data Processing & File I/O
    subgraph "Data Processing & File I/O"
        DP["Data Processing Module (dataProcessing.py)"]:::data
        ORIG["Original.txt"]:::data
        OUT["Output.txt"]:::data
        INF["Persistent Store (Infos/)"]:::data
    end

    %% Orchestration
    subgraph "Orchestration"
        M["Entry Point (Main.py)"]:::orch
    end

    %% Interactions
    UI -->|"sends_data"| E
    UI -->|"sends_data"| D
    UI -->|"displays_results"| DP

    E -->|"requests_keys"| K
    D -->|"requests_keys"| K

    E -->|"uses_threads"| TH
    D -->|"uses_threads"| TH

    E -->|"processes_data"| DP
    D -->|"processes_data"| DP

    DP -->|"reads/writes"| ORIG
    DP -->|"reads/writes"| OUT

    K -->|"stores_to"| INF
    DP -->|"logs_info"| INF

    M -->|"triggers_encryption"| E
    M -->|"triggers_decryption"| D
    M -->|"orchestrates_data"| DP

    %% Click Events
    click UI "https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography/blob/main/app.py"
    click T "https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography/tree/main/templates/"
    click S "https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography/tree/main/static/"
    click SI "https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography/tree/main/static/img"
    click E "https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography/blob/main/Encrypt.py"
    click D "https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography/blob/main/Decrypt.py"
    click K "https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography/blob/main/IVsKeys.py"
    click TH "https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography/blob/main/Threads.py"
    click DP "https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography/blob/main/dataProcessing.py"
    click ORIG "https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography/blob/main/Original.txt"
    click OUT "https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography/blob/main/Output.txt"
    click INF "https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography/tree/main/Infos/"
    click M "https://github.com/siddharthbhamare01/secure-file-store-using-hybridcryptography/blob/main/Main.py"

    %% Styles
    classDef ui fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef engine fill:#ABEBC6,stroke:#1E8449,stroke-width:2px;
    classDef data fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef orch fill:#F5CBA7,stroke:#D35400,stroke-width:2px;
```
