# m000gg/camougg architecture

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

- Interactive diagram: https://gitdiagram.com/m000gg/camougg
- Repository: https://github.com/m000gg/camougg

## Overview

camougg is a local-first terminal application for password-protecting arbitrary files hidden in PNG or JPEG images, then extracting them. The main workflow is user → TUI → file selection and password/output choices → service → format-specific image handling and steganography → saved carrier or recovered payload. The graph also preserves the documented audio/video placeholder screens and a separate message-oriented engine path present in the source index. Evidence is limited to the README and shown excerpts or source-index references; unsampled implementation details are not inferred.

Main entry points: [`src/camougg/core/service.py`](https://github.com/m000gg/camougg/blob/main/src/camougg/core/service.py) (File service), [`src/camougg/tui/screens/photo/photo_stego_screen.py`](https://github.com/m000gg/camougg/blob/main/src/camougg/tui/screens/photo/photo_stego_screen.py) (Photo workflow), [`src/camougg/tui/app.py`](https://github.com/m000gg/camougg/blob/main/src/camougg/tui/app.py) (TUI app), [`src/camougg/tui/screens/main/main_menu_screen.py`](https://github.com/m000gg/camougg/blob/main/src/camougg/tui/screens/main/main_menu_screen.py) (Main menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Terminal interface"]
  node_app["TUI app<br/>[app.py]"]
  node_menu["Main menu"]
  node_photo["Photo workflow"]
  node_picker["File picker"]
  node_placeholders["Audio/video screens"]
end

subgraph group_workflow["File workflow"]
  node_service["File service<br/>[service.py]"]
  node_payload["Payload I/O<br/>[payload_io.py]"]
end

subgraph group_stego["Steganography"]
  node_steganography["Steganography<br/>[steganography.py]"]
  node_crypto2["Password permutation<br/>[CSPRN_generator.py]"]
  node_legacy["Message engine<br/>[camougg_engine.py]"]
  node_writer["Message writer<br/>[steg_write.py]"]
  node_reader["Message reader<br/>[steg_read.py]"]
  node_crypto["Pixel permutation<br/>[CSPRNGenerator.py]"]
end

subgraph group_formats["Image formats"]
  node_png["PNG handler<br/>[png_handler.py]"]
  node_jpeg["JPEG handler<br/>[jpeg_handler.py]"]
end

node_user(("User"))
node_carrier["PNG/JPEG carrier"]
node_recovered["Recovered payload"]

node_user -->|"uses"| node_app
node_app -->|"opens"| node_menu
node_app -->|"registers"| node_photo
node_app -->|"registers"| node_placeholders
node_menu -->|"opens"| node_photo
node_menu -->|"opens"| node_placeholders
node_user -->|"chooses operation"| node_photo
node_photo -->|"opens picker"| node_picker
node_photo -->|"invokes embed/extract"| node_service
node_service -->|"reads/writes payload"| node_payload
node_service -->|"embeds/extracts data"| node_steganography
node_service -->|"loads/saves PNG"| node_png
node_service -->|"loads/saves JPEG"| node_jpeg
node_steganography -->|"uses permutation"| node_crypto2
node_steganography -->|"writes/reads carrier data"| node_carrier
node_payload -->|"writes extracted file"| node_recovered
node_legacy -->|"calls writer"| node_writer
node_legacy -->|"calls reader"| node_reader
node_writer -->|"uses permutation"| node_crypto
node_reader -->|"uses permutation"| node_crypto

click node_app "https://github.com/m000gg/camougg/blob/main/src/camougg/tui/app.py"
click node_menu "https://github.com/m000gg/camougg/blob/main/src/camougg/tui/screens/main/main_menu_screen.py"
click node_photo "https://github.com/m000gg/camougg/blob/main/src/camougg/tui/screens/photo/photo_stego_screen.py"
click node_picker "https://github.com/m000gg/camougg/blob/main/src/camougg/tui/screens/other/file_picker_screen.py"
click node_placeholders "https://github.com/m000gg/camougg/blob/main/src/camougg/tui/screens/other/to_be_done_screen.py"
click node_service "https://github.com/m000gg/camougg/blob/main/src/camougg/core/service.py"
click node_payload "https://github.com/m000gg/camougg/blob/main/src/camougg/core/payload_io.py"
click node_steganography "https://github.com/m000gg/camougg/blob/main/src/camougg/core/steganography.py"
click node_crypto2 "https://github.com/m000gg/camougg/blob/main/src/camougg/crypto/CSPRN_generator.py"
click node_png "https://github.com/m000gg/camougg/blob/main/src/camougg/formats/png_handler.py"
click node_jpeg "https://github.com/m000gg/camougg/blob/main/src/camougg/formats/jpeg_handler.py"
click node_legacy "https://github.com/m000gg/camougg/blob/main/src/camougg/core/camougg_engine.py"
click node_writer "https://github.com/m000gg/camougg/blob/main/src/camougg/core/steg/steg_write.py"
click node_reader "https://github.com/m000gg/camougg/blob/main/src/camougg/core/steg/steg_read.py"
click node_crypto "https://github.com/m000gg/camougg/blob/main/src/camougg/crypto/CSPRNGenerator.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_menu,node_photo,node_picker,node_placeholders,node_user toneBlue
class node_service,node_payload toneAmber
class node_steganography,node_crypto2,node_legacy,node_writer,node_reader,node_crypto toneMint
class node_png,node_jpeg toneRose
class node_carrier,node_recovered toneIndigo
```

## Components

### Terminal interface

- [TUI app](https://github.com/m000gg/camougg/blob/main/src/camougg/tui/app.py): `src/camougg/tui/app.py`
- [Main menu](https://github.com/m000gg/camougg/blob/main/src/camougg/tui/screens/main/main_menu_screen.py): `src/camougg/tui/screens/main/main_menu_screen.py`
- [Photo workflow](https://github.com/m000gg/camougg/blob/main/src/camougg/tui/screens/photo/photo_stego_screen.py): `src/camougg/tui/screens/photo/photo_stego_screen.py`
- [File picker](https://github.com/m000gg/camougg/blob/main/src/camougg/tui/screens/other/file_picker_screen.py): `src/camougg/tui/screens/other/file_picker_screen.py`
- [Audio/video screens](https://github.com/m000gg/camougg/blob/main/src/camougg/tui/screens/other/to_be_done_screen.py): `src/camougg/tui/screens/other/to_be_done_screen.py`

### File workflow

- [File service](https://github.com/m000gg/camougg/blob/main/src/camougg/core/service.py): `src/camougg/core/service.py`
- [Payload I/O](https://github.com/m000gg/camougg/blob/main/src/camougg/core/payload_io.py): `src/camougg/core/payload_io.py`

### Steganography

- [Steganography](https://github.com/m000gg/camougg/blob/main/src/camougg/core/steganography.py): `src/camougg/core/steganography.py`
- [Password permutation](https://github.com/m000gg/camougg/blob/main/src/camougg/crypto/CSPRN_generator.py): `src/camougg/crypto/CSPRN_generator.py`
- [Message engine](https://github.com/m000gg/camougg/blob/main/src/camougg/core/camougg_engine.py): `src/camougg/core/camougg_engine.py`
- [Message writer](https://github.com/m000gg/camougg/blob/main/src/camougg/core/steg/steg_write.py): `src/camougg/core/steg/steg_write.py`
- [Message reader](https://github.com/m000gg/camougg/blob/main/src/camougg/core/steg/steg_read.py): `src/camougg/core/steg/steg_read.py`
- [Pixel permutation](https://github.com/m000gg/camougg/blob/main/src/camougg/crypto/CSPRNGenerator.py): `src/camougg/crypto/CSPRNGenerator.py`

### Image formats

- [PNG handler](https://github.com/m000gg/camougg/blob/main/src/camougg/formats/png_handler.py): `src/camougg/formats/png_handler.py`
- [JPEG handler](https://github.com/m000gg/camougg/blob/main/src/camougg/formats/jpeg_handler.py): `src/camougg/formats/jpeg_handler.py`

### Other components

- **User**
- **PNG/JPEG carrier**
- **Recovered payload**

## Connections

- User → TUI app: uses (evidence: `README.md`)
- TUI app → Main menu: opens (evidence: `src/camougg/tui/app.py`)
- TUI app → Photo workflow: registers (evidence: `src/camougg/tui/app.py`)
- TUI app → Audio/video screens: registers (evidence: `src/camougg/tui/app.py`)
- Main menu → Photo workflow: opens (evidence: `src/camougg/tui/screens/main/main_menu_screen.py`)
- Main menu → Audio/video screens: opens (evidence: `src/camougg/tui/screens/main/main_menu_screen.py`)
- User → Photo workflow: chooses operation (evidence: `README.md`)
- Photo workflow → File picker: opens picker (evidence: `src/camougg/tui/screens/photo/photo_stego_screen.py`)
- Photo workflow → File service: invokes embed/extract (evidence: `src/camougg/tui/screens/photo/photo_stego_screen.py`)
- File service → Payload I/O: reads/writes payload (evidence: `src/camougg/core/service.py`)
- File service → Steganography: embeds/extracts data (evidence: `src/camougg/core/service.py`)
- File service → PNG handler: loads/saves PNG (evidence: `src/camougg/core/service.py`)
- File service → JPEG handler: loads/saves JPEG (evidence: `src/camougg/core/service.py`)
- Steganography → Password permutation: uses permutation (evidence: `src/camougg/core/steganography.py`)
- Steganography → PNG/JPEG carrier: writes/reads carrier data (evidence: `README.md`)
- Payload I/O → Recovered payload: writes extracted file
- Message engine → Message writer: calls writer (evidence: `src/camougg/core/camougg_engine.py`)
- Message engine → Message reader: calls reader (evidence: `src/camougg/core/camougg_engine.py`)
- Message writer → Pixel permutation: uses permutation (evidence: `src/camougg/core/steg/steg_write.py`)
- Message reader → Pixel permutation: uses permutation (evidence: `src/camougg/core/steg/steg_read.py`)
