# alvinlemar/malware-steno architecture

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

- Interactive diagram: https://gitdiagram.com/alvinlemar/malware-steno
- Repository: https://github.com/alvinlemar/malware-steno

## Overview

malware-steno is a Flask-based file-scanning and image-steganography tool. A user uploads a file for steganography checks and malware classification, or submits a PNG/BMP image and secret message for encoding and download. The sampled application and utility code show those runtime paths; README also documents extraction, while the standalone feature-based stego model is not wired into the sampled app. Other media detection paths are explicit stubs.

Main entry points: [`stego-detector/app.py`](https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/app.py) (Flask Routes), [`stego-detector/utils/detectors.py`](https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/utils/detectors.py) (Stego Detection), [`stego-detector/utils/malware_detector.py`](https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/utils/malware_detector.py) (Malware Classifier), [`stego-detector/utils/encoder.py`](https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/utils/encoder.py) (LSB Encoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Interface"]
  node_app["Flask Routes<br/>[app.py]"]
  node_upload[("Uploaded Files")]
  node_home["Scan Form<br/>[index.html]"]
  node_result["Scan Results<br/>[result.html]"]
  node_encodeform["Encode Form<br/>[encode.html]"]
  node_encoderesult["Encode Results<br/>[encode_result.html]"]
end

subgraph group_scan["File Analysis"]
  node_features["Feature Extraction<br/>[app.py]"]
  node_malware["Malware Classifier"]
  node_malmodel[("Malware Model<br/>[malware_rf.pkl]")]
end

subgraph group_stego["Steganography"]
  node_stegodetect["Stego Detection<br/>[detectors.py]"]
  node_encoder["LSB Encoder<br/>[encoder.py]"]
  node_encoded[("Encoded Images")]
  node_extract["Message Extraction<br/>[detectors.py]"]
  node_media["Audio/Video Stubs<br/>[detectors.py]"]
end

node_user(("User"))

node_user -.->|"submits file"| node_app
node_app -->|"renders"| node_home
node_app -->|"renders"| node_encodeform
node_app -->|"saves upload"| node_upload
node_app -->|"checks steganography"| node_stegodetect
node_app -->|"extracts features"| node_features
node_features -->|"passes features"| node_malware
node_malware -->|"loads and predicts"| node_malmodel
node_app -->|"renders results"| node_result
node_app -->|"encodes message"| node_encoder
node_encoder -->|"writes image"| node_encoded
node_app -->|"renders results"| node_encoderesult
node_app -->|"serves download"| node_encoded
node_stegodetect -->|"reveals message"| node_extract
node_stegodetect -->|"dispatches media"| node_media
node_user -.->|"requests pages"| node_app

click node_app "https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/app.py"
click node_upload "https://github.com/alvinlemar/malware-steno/tree/main/stego-detector/uploads"
click node_home "https://github.com/alvinlemar/malware-steno/blob/main/index.html"
click node_result "https://github.com/alvinlemar/malware-steno/blob/main/result.html"
click node_encodeform "https://github.com/alvinlemar/malware-steno/blob/main/encode.html"
click node_encoderesult "https://github.com/alvinlemar/malware-steno/blob/main/encode_result.html"
click node_features "https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/app.py"
click node_stegodetect "https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/utils/detectors.py"
click node_malware "https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/utils/malware_detector.py"
click node_malmodel "https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/models/malware_rf.pkl"
click node_encoder "https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/utils/encoder.py"
click node_encoded "https://github.com/alvinlemar/malware-steno/tree/main/stego-detector/uploads/encoded"
click node_extract "https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/utils/detectors.py"
click node_media "https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/utils/detectors.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_app,node_upload,node_home,node_result,node_encodeform,node_encoderesult,node_user toneBlue
class node_features,node_malware,node_malmodel toneAmber
class node_stegodetect,node_encoder,node_encoded,node_extract,node_media toneMint
```

## Components

### Web Interface

- [Flask Routes](https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/app.py): `stego-detector/app.py`
- [Uploaded Files](https://github.com/alvinlemar/malware-steno/tree/main/stego-detector/uploads): `stego-detector/uploads`
- [Scan Form](https://github.com/alvinlemar/malware-steno/blob/main/index.html): `index.html`
- [Scan Results](https://github.com/alvinlemar/malware-steno/blob/main/result.html): `result.html`
- [Encode Form](https://github.com/alvinlemar/malware-steno/blob/main/encode.html): `encode.html`
- [Encode Results](https://github.com/alvinlemar/malware-steno/blob/main/encode_result.html): `encode_result.html`

### File Analysis

- [Feature Extraction](https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/app.py): `stego-detector/app.py`
- [Malware Classifier](https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/utils/malware_detector.py): `stego-detector/utils/malware_detector.py`
- [Malware Model](https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/models/malware_rf.pkl): `stego-detector/models/malware_rf.pkl`

### Steganography

- [Stego Detection](https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/utils/detectors.py): `stego-detector/utils/detectors.py`
- [LSB Encoder](https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/utils/encoder.py): `stego-detector/utils/encoder.py`
- [Encoded Images](https://github.com/alvinlemar/malware-steno/tree/main/stego-detector/uploads/encoded): `stego-detector/uploads/encoded`
- [Message Extraction](https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/utils/detectors.py): `stego-detector/utils/detectors.py`
- [Audio/Video Stubs](https://github.com/alvinlemar/malware-steno/blob/main/stego-detector/utils/detectors.py): `stego-detector/utils/detectors.py`

### Other components

- **User**

## Connections

- User → Flask Routes: submits file
- Flask Routes → Scan Form: renders (evidence: `stego-detector/app.py`)
- Flask Routes → Encode Form: renders (evidence: `stego-detector/app.py`)
- Flask Routes → Uploaded Files: saves upload (evidence: `stego-detector/app.py`)
- Flask Routes → Stego Detection: checks steganography (evidence: `stego-detector/app.py`)
- Flask Routes → Feature Extraction: extracts features (evidence: `stego-detector/app.py`)
- Feature Extraction → Malware Classifier: passes features (evidence: `stego-detector/app.py`)
- Malware Classifier → Malware Model: loads and predicts (evidence: `stego-detector/utils/malware_detector.py`)
- Flask Routes → Scan Results: renders results (evidence: `stego-detector/app.py`)
- Flask Routes → LSB Encoder: encodes message (evidence: `stego-detector/app.py`)
- LSB Encoder → Encoded Images: writes image
- Flask Routes → Encode Results: renders results (evidence: `stego-detector/app.py`)
- Flask Routes → Encoded Images: serves download (evidence: `stego-detector/app.py`)
- Stego Detection → Message Extraction: reveals message (evidence: `stego-detector/utils/detectors.py`)
- Stego Detection → Audio/Video Stubs: dispatches media (evidence: `stego-detector/utils/detectors.py`)
- User → Flask Routes: requests pages
