# esaithoran/cryptography-and-steganography architecture

> Architecture diagram of the GitHub repository esaithoran/cryptography-and-steganography, 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/esaithoran/cryptography-and-steganography
- Repository: https://github.com/esaithoran/cryptography-and-steganography

## Overview

This Flask web application lets users hide encrypted text in image, video, audio, or text carriers, then upload a carrier and key to retrieve the message. The routes in app.py orchestrate encryption/decryption and each format-specific encoder or decoder; the UI is served from templates/index.html. The README documents randomized LSB hiding for image/video/audio and zero-width-character text hiding. Relationships shown here are limited to those documented by the README or visible in the app.py excerpt; unsampled route details are not inferred.

Main entry points: [`app.py`](https://github.com/esaithoran/cryptography-and-steganography/blob/main/app.py) (Web routes), [`templates/index.html`](https://github.com/esaithoran/cryptography-and-steganography/blob/main/templates/index.html) (Browser interface), [`encryption.py`](https://github.com/esaithoran/cryptography-and-steganography/blob/main/encryption.py) (Encrypt message), [`image_steganography.py`](https://github.com/esaithoran/cryptography-and-steganography/blob/main/image_steganography.py) (Image hiding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_flask["Web routes<br/>[app.py]"]
  node_ui["Browser interface<br/>[index.html]"]
  node_uploads[("Uploaded carriers")]
  node_result["Hidden or revealed data"]
end

subgraph group_crypto["Cryptography"]
  node_crypto_enc["Encrypt message<br/>[encryption.py]"]
  node_crypto_dec["Decrypt message<br/>[decryption.py]"]
end

subgraph group_stego["Steganography"]
  node_image["Image hiding"]
  node_video["Video hiding"]
  node_audio["Audio hiding"]
  node_text["Text hiding"]
end

node_user(("User"))

node_user -->|"uses"| node_ui
node_ui -.->|"submits requests"| node_flask
node_flask -->|"renders"| node_ui
node_flask -->|"saves carriers"| node_uploads
node_flask -->|"encrypts"| node_crypto_enc
node_flask -->|"decrypts"| node_crypto_dec
node_flask -->|"encodes or decodes"| node_image
node_flask -->|"encodes or decodes"| node_video
node_flask -->|"encodes or decodes"| node_audio
node_flask -->|"encodes or decodes"| node_text
node_crypto_enc -->|"returns ciphertext and key"| node_flask
node_image -->|"embeds or extracts"| node_result
node_video -->|"embeds or extracts"| node_result
node_audio -->|"embeds or extracts"| node_result
node_text -->|"embeds or extracts"| node_result

click node_flask "https://github.com/esaithoran/cryptography-and-steganography/blob/main/app.py"
click node_ui "https://github.com/esaithoran/cryptography-and-steganography/blob/main/templates/index.html"
click node_crypto_enc "https://github.com/esaithoran/cryptography-and-steganography/blob/main/encryption.py"
click node_crypto_dec "https://github.com/esaithoran/cryptography-and-steganography/blob/main/decryption.py"
click node_image "https://github.com/esaithoran/cryptography-and-steganography/blob/main/image_steganography.py"
click node_video "https://github.com/esaithoran/cryptography-and-steganography/blob/main/video_steganography.py"
click node_audio "https://github.com/esaithoran/cryptography-and-steganography/blob/main/audio_steganography.py"
click node_text "https://github.com/esaithoran/cryptography-and-steganography/blob/main/text_steganography.py"

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,node_ui,node_uploads,node_result,node_user toneBlue
class node_crypto_enc,node_crypto_dec toneAmber
class node_image,node_video,node_audio,node_text toneMint
```

## Components

### Web interface

- [Web routes](https://github.com/esaithoran/cryptography-and-steganography/blob/main/app.py): `app.py`
- [Browser interface](https://github.com/esaithoran/cryptography-and-steganography/blob/main/templates/index.html): `templates/index.html`
- **Uploaded carriers**
- **Hidden or revealed data**

### Cryptography

- [Encrypt message](https://github.com/esaithoran/cryptography-and-steganography/blob/main/encryption.py): `encryption.py`
- [Decrypt message](https://github.com/esaithoran/cryptography-and-steganography/blob/main/decryption.py): `decryption.py`

### Steganography

- [Image hiding](https://github.com/esaithoran/cryptography-and-steganography/blob/main/image_steganography.py): `image_steganography.py`
- [Video hiding](https://github.com/esaithoran/cryptography-and-steganography/blob/main/video_steganography.py): `video_steganography.py`
- [Audio hiding](https://github.com/esaithoran/cryptography-and-steganography/blob/main/audio_steganography.py): `audio_steganography.py`
- [Text hiding](https://github.com/esaithoran/cryptography-and-steganography/blob/main/text_steganography.py): `text_steganography.py`

### Other components

- **User**

## Connections

- User → Browser interface: uses (evidence: `README.md`)
- Browser interface → Web routes: submits requests
- Web routes → Browser interface: renders (evidence: `app.py`)
- Web routes → Uploaded carriers: saves carriers (evidence: `app.py`)
- Web routes → Encrypt message: encrypts (evidence: `app.py`)
- Web routes → Decrypt message: decrypts (evidence: `app.py`)
- Web routes → Image hiding: encodes or decodes (evidence: `app.py`)
- Web routes → Video hiding: encodes or decodes (evidence: `app.py`)
- Web routes → Audio hiding: encodes or decodes (evidence: `app.py`)
- Web routes → Text hiding: encodes or decodes (evidence: `app.py`)
- Encrypt message → Web routes: returns ciphertext and key (evidence: `app.py`)
- Image hiding → Hidden or revealed data: embeds or extracts (evidence: `README.md`)
- Video hiding → Hidden or revealed data: embeds or extracts (evidence: `README.md`)
- Audio hiding → Hidden or revealed data: embeds or extracts (evidence: `README.md`)
- Text hiding → Hidden or revealed data: embeds or extracts (evidence: `README.md`)
