# mehranqadirian/securemessage architecture

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

- Interactive diagram: https://gitdiagram.com/mehranqadirian/securemessage
- Repository: https://github.com/mehranqadirian/securemessage

## Overview

Secure Message is a GTK desktop app for encrypting text, files, and voice using password-based or post-quantum protection. The main window is the entry point: users encrypt or decrypt messages there, or open the Files, Voice, and Keys workflows. Files can be encrypted plainly or hidden in image/audio carriers; Voice supports recording, transcription, and encrypted voice. The graph preserves these documented capabilities, plus updates and key persistence. Some subsystem links are documented rather than visible as calls in the excerpts, so those edges are dashed where their implementation-level wiring is uncertain.

Main entry points: [`main.py`](https://github.com/mehranqadirian/securemessage/blob/main/main.py) (Main window), [`voice_studio.py`](https://github.com/mehranqadirian/securemessage/blob/main/voice_studio.py) (Voice studio), [`files_studio.py`](https://github.com/mehranqadirian/securemessage/blob/main/files_studio.py) (Files studio), [`keystore.py`](https://github.com/mehranqadirian/securemessage/blob/main/keystore.py) (Key store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_main["Main window<br/>[main.py]"]
  node_text["Text encrypt/decrypt<br/>[main.py]"]
end

subgraph group_security["Protection and keys"]
  node_protection["Protection inputs<br/>[protection.py]"]
  node_crypto["Crypto engine<br/>[crypto_engine.py]"]
  node_keysui["Key manager<br/>[keys_window.py]"]
  node_keystore["Key store<br/>[keystore.py]"]
  node_keydata[("Key data")]
end

subgraph group_files["File workflows"]
  node_filesui["Files studio<br/>[files_studio.py]"]
  node_filevault["File vault<br/>[file_vault.py]"]
  node_vault["Carrier vault<br/>[vault.py]"]
  node_image["Image hiding<br/>[stego_image.py]"]
  node_filewindow["File vault window"]
end

subgraph group_voice["Voice workflows"]
  node_voiceui["Voice studio<br/>[voice_studio.py]"]
  node_audio["Audio I/O<br/>[audio.py]"]
  node_voicecodec["Voice codec<br/>[voice_codec.py]"]
  node_speech["Speech to text<br/>[stt.py]"]
end

subgraph group_support["App services"]
  node_updaterui["Update dialog<br/>[update_window.py]"]
  node_updater["Update service<br/>[updater.py]"]
  node_settings[("User settings<br/>[settings.py]")]
  node_theme["Theme<br/>[theme.py]"]
  node_widgets["Shared widgets<br/>[widgets.py]"]
  node_bootstrap["Dependency bootstrap<br/>[bootstrap.py]"]
end

node_user(("User"))
node_releaseapi{{"GitHub releases"}}

node_user -->|"opens"| node_main
node_main -->|"offers"| node_text
node_text -.->|"collects credentials"| node_protection
node_text -.->|"encrypts or decrypts"| node_crypto
node_main -->|"opens Files"| node_filesui
node_filesui -.->|"protects files"| node_filevault
node_filesui -.->|"uses carrier vault"| node_vault
node_filesui -.->|"hides in images"| node_image
node_main -->|"opens Voice"| node_voiceui
node_voiceui -->|"records and plays"| node_audio
node_voiceui -->|"encodes voice"| node_voicecodec
node_voiceui -->|"transcribes"| node_speech
node_voicecodec -.->|"seals audio"| node_crypto
node_main -->|"opens Keys"| node_keysui
node_keysui -->|"manages keys"| node_keystore
node_keystore -->|"seals secret keys"| node_crypto
node_keystore -->|"reads and writes"| node_keydata
node_main -->|"opens updates"| node_updaterui
node_updaterui -->|"checks and installs"| node_updater
node_updater -.->|"checks releases"| node_releaseapi
node_main -.->|"loads preferences"| node_settings
node_main -.->|"applies appearance"| node_theme
node_main -.->|"uses shared UI"| node_widgets
node_main -.->|"checks dependencies"| node_bootstrap
node_filewindow -->|"uses vault"| node_filevault
node_filewindow -->|"collects protection"| node_protection
node_voiceui -->|"collects protection"| node_protection

click node_main "https://github.com/mehranqadirian/securemessage/blob/main/main.py"
click node_text "https://github.com/mehranqadirian/securemessage/blob/main/main.py"
click node_protection "https://github.com/mehranqadirian/securemessage/blob/main/protection.py"
click node_crypto "https://github.com/mehranqadirian/securemessage/blob/main/crypto_engine.py"
click node_keysui "https://github.com/mehranqadirian/securemessage/blob/main/keys_window.py"
click node_keystore "https://github.com/mehranqadirian/securemessage/blob/main/keystore.py"
click node_filesui "https://github.com/mehranqadirian/securemessage/blob/main/files_studio.py"
click node_filevault "https://github.com/mehranqadirian/securemessage/blob/main/file_vault.py"
click node_vault "https://github.com/mehranqadirian/securemessage/blob/main/vault.py"
click node_image "https://github.com/mehranqadirian/securemessage/blob/main/stego_image.py"
click node_filewindow "https://github.com/mehranqadirian/securemessage/blob/main/file_vault_window.py"
click node_voiceui "https://github.com/mehranqadirian/securemessage/blob/main/voice_studio.py"
click node_audio "https://github.com/mehranqadirian/securemessage/blob/main/audio.py"
click node_voicecodec "https://github.com/mehranqadirian/securemessage/blob/main/voice_codec.py"
click node_speech "https://github.com/mehranqadirian/securemessage/blob/main/stt.py"
click node_updaterui "https://github.com/mehranqadirian/securemessage/blob/main/update_window.py"
click node_updater "https://github.com/mehranqadirian/securemessage/blob/main/updater.py"
click node_settings "https://github.com/mehranqadirian/securemessage/blob/main/settings.py"
click node_theme "https://github.com/mehranqadirian/securemessage/blob/main/theme.py"
click node_widgets "https://github.com/mehranqadirian/securemessage/blob/main/widgets.py"
click node_bootstrap "https://github.com/mehranqadirian/securemessage/blob/main/bootstrap.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_main,node_text,node_user toneBlue
class node_protection,node_crypto,node_keysui,node_keystore,node_keydata toneAmber
class node_filesui,node_filevault,node_vault,node_image,node_filewindow toneMint
class node_voiceui,node_audio,node_voicecodec,node_speech toneRose
class node_updaterui,node_updater,node_settings,node_theme,node_widgets,node_bootstrap,node_releaseapi toneIndigo
```

## Components

### Desktop app

- [Main window](https://github.com/mehranqadirian/securemessage/blob/main/main.py): `main.py`
- [Text encrypt/decrypt](https://github.com/mehranqadirian/securemessage/blob/main/main.py): `main.py`

### Protection and keys

- [Protection inputs](https://github.com/mehranqadirian/securemessage/blob/main/protection.py): `protection.py`
- [Crypto engine](https://github.com/mehranqadirian/securemessage/blob/main/crypto_engine.py): `crypto_engine.py`
- [Key manager](https://github.com/mehranqadirian/securemessage/blob/main/keys_window.py): `keys_window.py`
- [Key store](https://github.com/mehranqadirian/securemessage/blob/main/keystore.py): `keystore.py`
- **Key data**

### File workflows

- [Files studio](https://github.com/mehranqadirian/securemessage/blob/main/files_studio.py): `files_studio.py`
- [File vault](https://github.com/mehranqadirian/securemessage/blob/main/file_vault.py): `file_vault.py`
- [Carrier vault](https://github.com/mehranqadirian/securemessage/blob/main/vault.py): `vault.py`
- [Image hiding](https://github.com/mehranqadirian/securemessage/blob/main/stego_image.py): `stego_image.py`
- [File vault window](https://github.com/mehranqadirian/securemessage/blob/main/file_vault_window.py): `file_vault_window.py`

### Voice workflows

- [Voice studio](https://github.com/mehranqadirian/securemessage/blob/main/voice_studio.py): `voice_studio.py`
- [Audio I/O](https://github.com/mehranqadirian/securemessage/blob/main/audio.py): `audio.py`
- [Voice codec](https://github.com/mehranqadirian/securemessage/blob/main/voice_codec.py): `voice_codec.py`
- [Speech to text](https://github.com/mehranqadirian/securemessage/blob/main/stt.py): `stt.py`

### App services

- [Update dialog](https://github.com/mehranqadirian/securemessage/blob/main/update_window.py): `update_window.py`
- [Update service](https://github.com/mehranqadirian/securemessage/blob/main/updater.py): `updater.py`
- [User settings](https://github.com/mehranqadirian/securemessage/blob/main/settings.py): `settings.py`
- [Theme](https://github.com/mehranqadirian/securemessage/blob/main/theme.py): `theme.py`
- [Shared widgets](https://github.com/mehranqadirian/securemessage/blob/main/widgets.py): `widgets.py`
- [Dependency bootstrap](https://github.com/mehranqadirian/securemessage/blob/main/bootstrap.py): `bootstrap.py`

### Other components

- **User**
- **GitHub releases**

## Connections

- User → Main window: opens (evidence: `README.md`)
- Main window → Text encrypt/decrypt: offers (evidence: `README.md`)
- Text encrypt/decrypt → Protection inputs: collects credentials (evidence: `main.py`)
- Text encrypt/decrypt → Crypto engine: encrypts or decrypts (evidence: `main.py`)
- Main window → Files studio: opens Files (evidence: `README.md`)
- Files studio → File vault: protects files
- Files studio → Carrier vault: uses carrier vault (evidence: `files_studio.py`)
- Files studio → Image hiding: hides in images (evidence: `files_studio.py`)
- Main window → Voice studio: opens Voice (evidence: `README.md`)
- Voice studio → Audio I/O: records and plays (evidence: `voice_studio.py`)
- Voice studio → Voice codec: encodes voice (evidence: `voice_studio.py`)
- Voice studio → Speech to text: transcribes (evidence: `voice_studio.py`)
- Voice codec → Crypto engine: seals audio (evidence: `voice_codec.py`)
- Main window → Key manager: opens Keys (evidence: `README.md`)
- Key manager → Key store: manages keys (evidence: `keys_window.py`)
- Key store → Crypto engine: seals secret keys (evidence: `keystore.py`)
- Key store → Key data: reads and writes (evidence: `keystore.py`)
- Main window → Update dialog: opens updates (evidence: `main.py`)
- Update dialog → Update service: checks and installs (evidence: `update_window.py`)
- Update service → GitHub releases: checks releases
- Main window → User settings: loads preferences (evidence: `main.py`)
- Main window → Theme: applies appearance (evidence: `main.py`)
- Main window → Shared widgets: uses shared UI (evidence: `main.py`)
- Main window → Dependency bootstrap: checks dependencies (evidence: `main.py`)
- File vault window → File vault: uses vault (evidence: `file_vault_window.py`)
- File vault window → Protection inputs: collects protection (evidence: `file_vault_window.py`)
- Voice studio → Protection inputs: collects protection (evidence: `voice_studio.py`)
