# goudatharun30/aegispix architecture

> Architecture diagram of the GitHub repository goudatharun30/aegispix, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/goudatharun30/aegispix
- Repository: https://github.com/goudatharun30/aegispix

## Overview

Aegispix is a Flask application for encrypting images and sharing them with authenticated recipients. Its main workflow accepts an uploaded image and secret key, encrypts the image, records sharing metadata, then lets the recipient verify the key and decrypt the image. The graph also shows account management, history, and statistics, plus the shared chaotic-parameter/S-box layer used by both crypto paths. The README documents security-analysis metrics, but the sampled source does not show their implementation, so they are not mapped as runtime components.

Main entry points: [`app.py`](https://github.com/goudatharun30/aegispix/blob/main/app.py) (Flask routes), [`database.db`](https://github.com/goudatharun30/aegispix/blob/main/database.db) (SQLite records), [`encryption.py`](https://github.com/goudatharun30/aegispix/blob/main/encryption.py) (Image encryption), [`decryption.py`](https://github.com/goudatharun30/aegispix/blob/main/decryption.py) (Image decryption)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_flask_app["Flask routes<br/>[app.py]"]
  node_accounts["Accounts<br/>[app.py]"]
  node_history_ui["History views<br/>[history.html]"]
  node_sender_ui["Sender view<br/>[sender.html]"]
  node_receiver_ui["Receiver view<br/>[receiver.html]"]
  node_stats_ui["Statistics view<br/>[stats.html]"]
end

subgraph group_sharing["Image sharing"]
  node_image_send["Image submission<br/>[app.py]"]
  node_image_receive["Image retrieval<br/>[app.py]"]
  node_image_history["History management<br/>[app.py]"]
  node_statistics["Usage statistics<br/>[app.py]"]
end

subgraph group_crypto["Image cryptography"]
  node_encryption["Image encryption<br/>[encryption.py]"]
  node_decryption["Image decryption<br/>[decryption.py]"]
  node_key_chaos["Key and chaos<br/>[utils.py]"]
end

subgraph group_state["Persistence and files"]
  node_sqlite[("SQLite records<br/>[database.db]")]
  node_uploads["Original uploads"]
  node_encrypted_files["Encrypted images"]
  node_decrypted_files["Decrypted images"]
end

node_user(("User"))

node_user -->|"uses"| node_flask_app
node_flask_app -->|"routes account actions"| node_accounts
node_flask_app -->|"routes upload"| node_image_send
node_flask_app -->|"routes retrieval"| node_image_receive
node_flask_app -->|"routes history"| node_image_history
node_flask_app -->|"routes statistics"| node_statistics
node_image_send -->|"calls"| node_encryption
node_image_receive -->|"calls"| node_decryption
node_encryption -->|"generates parameters"| node_key_chaos
node_decryption -->|"generates parameters"| node_key_chaos
node_image_send -->|"writes sharing records"| node_sqlite
node_image_receive -->|"reads sharing records"| node_sqlite
node_accounts -->|"reads and writes users"| node_sqlite
node_image_history -->|"queries history"| node_sqlite
node_statistics -->|"counts records"| node_sqlite
node_image_send -->|"saves upload"| node_uploads
node_image_send -->|"writes encrypted image"| node_encrypted_files
node_image_receive -->|"reads encrypted image"| node_encrypted_files
node_image_receive -->|"writes decrypted image"| node_decrypted_files
node_flask_app -->|"renders"| node_sender_ui
node_flask_app -->|"renders"| node_receiver_ui
node_flask_app -->|"renders"| node_history_ui
node_flask_app -->|"renders"| node_stats_ui

click node_flask_app "https://github.com/goudatharun30/aegispix/blob/main/app.py"
click node_accounts "https://github.com/goudatharun30/aegispix/blob/main/app.py"
click node_history_ui "https://github.com/goudatharun30/aegispix/blob/main/templates/history.html"
click node_sender_ui "https://github.com/goudatharun30/aegispix/blob/main/templates/sender.html"
click node_receiver_ui "https://github.com/goudatharun30/aegispix/blob/main/templates/receiver.html"
click node_stats_ui "https://github.com/goudatharun30/aegispix/blob/main/templates/stats.html"
click node_image_send "https://github.com/goudatharun30/aegispix/blob/main/app.py"
click node_image_receive "https://github.com/goudatharun30/aegispix/blob/main/app.py"
click node_image_history "https://github.com/goudatharun30/aegispix/blob/main/app.py"
click node_statistics "https://github.com/goudatharun30/aegispix/blob/main/app.py"
click node_encryption "https://github.com/goudatharun30/aegispix/blob/main/encryption.py"
click node_decryption "https://github.com/goudatharun30/aegispix/blob/main/decryption.py"
click node_key_chaos "https://github.com/goudatharun30/aegispix/blob/main/utils.py"
click node_sqlite "https://github.com/goudatharun30/aegispix/blob/main/database.db"
click node_uploads "https://github.com/goudatharun30/aegispix/tree/main/static/uploads"
click node_encrypted_files "https://github.com/goudatharun30/aegispix/tree/main/static/encrypted"
click node_decrypted_files "https://github.com/goudatharun30/aegispix/tree/main/static/decrypted"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_flask_app,node_accounts,node_history_ui,node_sender_ui,node_receiver_ui,node_stats_ui,node_user toneBlue
class node_image_send,node_image_receive,node_image_history,node_statistics toneAmber
class node_encryption,node_decryption,node_key_chaos toneMint
class node_sqlite,node_uploads,node_encrypted_files,node_decrypted_files toneRose
```

## Components

### Web application

- [Flask routes](https://github.com/goudatharun30/aegispix/blob/main/app.py): `app.py`
- [Accounts](https://github.com/goudatharun30/aegispix/blob/main/app.py): `app.py`
- [History views](https://github.com/goudatharun30/aegispix/blob/main/templates/history.html): `templates/history.html`
- [Sender view](https://github.com/goudatharun30/aegispix/blob/main/templates/sender.html): `templates/sender.html`
- [Receiver view](https://github.com/goudatharun30/aegispix/blob/main/templates/receiver.html): `templates/receiver.html`
- [Statistics view](https://github.com/goudatharun30/aegispix/blob/main/templates/stats.html): `templates/stats.html`

### Image sharing

- [Image submission](https://github.com/goudatharun30/aegispix/blob/main/app.py): `app.py`
- [Image retrieval](https://github.com/goudatharun30/aegispix/blob/main/app.py): `app.py`
- [History management](https://github.com/goudatharun30/aegispix/blob/main/app.py): `app.py`
- [Usage statistics](https://github.com/goudatharun30/aegispix/blob/main/app.py): `app.py`

### Image cryptography

- [Image encryption](https://github.com/goudatharun30/aegispix/blob/main/encryption.py): `encryption.py`
- [Image decryption](https://github.com/goudatharun30/aegispix/blob/main/decryption.py): `decryption.py`
- [Key and chaos](https://github.com/goudatharun30/aegispix/blob/main/utils.py): `utils.py`

### Persistence and files

- [SQLite records](https://github.com/goudatharun30/aegispix/blob/main/database.db): `database.db`
- [Original uploads](https://github.com/goudatharun30/aegispix/tree/main/static/uploads): `static/uploads`
- [Encrypted images](https://github.com/goudatharun30/aegispix/tree/main/static/encrypted): `static/encrypted`
- [Decrypted images](https://github.com/goudatharun30/aegispix/tree/main/static/decrypted): `static/decrypted`

### Other components

- **User**

## Connections

- User → Flask routes: uses (evidence: `README.md`)
- Flask routes → Accounts: routes account actions (evidence: `app.py`)
- Flask routes → Image submission: routes upload (evidence: `app.py`)
- Flask routes → Image retrieval: routes retrieval (evidence: `app.py`)
- Flask routes → History management: routes history (evidence: `app.py`)
- Flask routes → Usage statistics: routes statistics (evidence: `app.py`)
- Image submission → Image encryption: calls (evidence: `app.py`)
- Image retrieval → Image decryption: calls (evidence: `app.py`)
- Image encryption → Key and chaos: generates parameters (evidence: `encryption.py`)
- Image decryption → Key and chaos: generates parameters (evidence: `decryption.py`)
- Image submission → SQLite records: writes sharing records (evidence: `app.py`)
- Image retrieval → SQLite records: reads sharing records (evidence: `app.py`)
- Accounts → SQLite records: reads and writes users (evidence: `app.py`)
- History management → SQLite records: queries history (evidence: `app.py`)
- Usage statistics → SQLite records: counts records (evidence: `app.py`)
- Image submission → Original uploads: saves upload (evidence: `app.py`)
- Image submission → Encrypted images: writes encrypted image (evidence: `app.py`)
- Image retrieval → Encrypted images: reads encrypted image (evidence: `app.py`)
- Image retrieval → Decrypted images: writes decrypted image (evidence: `app.py`)
- Flask routes → Sender view: renders (evidence: `app.py`)
- Flask routes → Receiver view: renders (evidence: `app.py`)
- Flask routes → History views: renders (evidence: `app.py`)
- Flask routes → Statistics view: renders (evidence: `app.py`)
