# emecyildiz/encryption architecture

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

- Interactive diagram: https://gitdiagram.com/emecyildiz/encryption
- Repository: https://github.com/emecyildiz/encryption

## Overview

KASA is a local-first Windows file-protection desktop app. Its main workflow is to collect files or folders, select protection or unlock, process each file with authenticated encryption, and present saved outputs and results. The repository also includes a read-only preview mode and an update flow. The graph uses README workflow and security statements plus the supplied source excerpts and index; unsampled implementation links are omitted or marked unverified.

Main entry points: [`AppWindow.cpp`](https://github.com/emecyildiz/encryption/blob/main/AppWindow.cpp) (File workspace), [`PreviewWindow.cpp`](https://github.com/emecyildiz/encryption/blob/main/PreviewWindow.cpp) (Preview window), [`main.cpp`](https://github.com/emecyildiz/encryption/blob/main/main.cpp) (Startup routing), [`encryption_engine.cpp`](https://github.com/emecyildiz/encryption/blob/main/encryption_engine.cpp) (Encryption engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop workflow"]
  node_main["Startup routing<br/>[main.cpp]"]
  node_workspace["File workspace<br/>[AppWindow.cpp]"]
  node_batch["Batch coordination<br/>[batch_runner.h]"]
  node_batch_state["Batch state<br/>[batch_state.h]"]
  node_output_path["Output placement<br/>[output_path.h]"]
  node_save["Verified saving<br/>[verified_save.cpp]"]
end

subgraph group_crypto["Protection and preview"]
  node_engine["Encryption engine"]
  node_plaintext["Plaintext handling<br/>[plaintext_output.h]"]
  node_preview_window["Preview window<br/>[PreviewWindow.cpp]"]
  node_preview_policy["Preview policy<br/>[preview_policy.h]"]
  node_preview_text["Text preview<br/>[preview_text.cpp]"]
  node_preview_image["Image preview<br/>[preview_image.cpp]"]
end

subgraph group_updates["Application updates"]
  node_updates_ui["Update controls<br/>[AppWindow.cpp]"]
  node_update_check["Release checking<br/>[update_check.cpp]"]
  node_manifest["Manifest validation"]
  node_download["Bounded download"]
  node_update_job["Update preparation<br/>[update_job.cpp]"]
  node_staging["Installer staging<br/>[update_staging.cpp]"]
end

subgraph group_publishing["Release metadata"]
  node_publisher["Metadata publisher"]
end

node_user(("User"))

node_user -->|"launches"| node_main
node_main -->|"opens"| node_workspace
node_main -->|"routes preview"| node_preview_window
node_user -->|"selects sources"| node_workspace
node_workspace -.->|"starts processing"| node_batch
node_workspace -.->|"tracks progress"| node_batch_state
node_workspace -.->|"processes files"| node_engine
node_workspace -.->|"chooses destination"| node_output_path
node_workspace -->|"saves outputs"| node_save
node_engine -->|"handles plaintext"| node_plaintext
node_preview_window -->|"decrypts preview"| node_engine
node_preview_window -.->|"applies limits"| node_preview_policy
node_preview_window -->|"renders text"| node_preview_text
node_preview_window -->|"renders images"| node_preview_image
node_user -->|"checks updates"| node_updates_ui
node_updates_ui -.->|"requests check"| node_update_check
node_update_check -.->|"checks metadata"| node_manifest
node_manifest -.->|"validates release"| node_download
node_update_job -.->|"prepares download"| node_download
node_update_job -.->|"stages installer"| node_staging
node_publisher -.->|"publishes metadata"| node_manifest

click node_main "https://github.com/emecyildiz/encryption/blob/main/main.cpp"
click node_workspace "https://github.com/emecyildiz/encryption/blob/main/AppWindow.cpp"
click node_batch "https://github.com/emecyildiz/encryption/blob/main/batch_runner.h"
click node_batch_state "https://github.com/emecyildiz/encryption/blob/main/batch_state.h"
click node_output_path "https://github.com/emecyildiz/encryption/blob/main/output_path.h"
click node_save "https://github.com/emecyildiz/encryption/blob/main/verified_save.cpp"
click node_engine "https://github.com/emecyildiz/encryption/blob/main/encryption_engine.cpp"
click node_plaintext "https://github.com/emecyildiz/encryption/blob/main/plaintext_output.h"
click node_preview_window "https://github.com/emecyildiz/encryption/blob/main/PreviewWindow.cpp"
click node_preview_policy "https://github.com/emecyildiz/encryption/blob/main/preview_policy.h"
click node_preview_text "https://github.com/emecyildiz/encryption/blob/main/preview_text.cpp"
click node_preview_image "https://github.com/emecyildiz/encryption/blob/main/preview_image.cpp"
click node_updates_ui "https://github.com/emecyildiz/encryption/blob/main/AppWindow.cpp"
click node_update_check "https://github.com/emecyildiz/encryption/blob/main/update_check.cpp"
click node_manifest "https://github.com/emecyildiz/encryption/blob/main/update_manifest.cpp"
click node_download "https://github.com/emecyildiz/encryption/blob/main/update_download.cpp"
click node_update_job "https://github.com/emecyildiz/encryption/blob/main/update_job.cpp"
click node_staging "https://github.com/emecyildiz/encryption/blob/main/update_staging.cpp"
click node_publisher "https://github.com/emecyildiz/encryption/blob/main/update_publisher.cpp"

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_workspace,node_batch,node_batch_state,node_output_path,node_save,node_user toneBlue
class node_engine,node_plaintext,node_preview_window,node_preview_policy,node_preview_text,node_preview_image toneAmber
class node_updates_ui,node_update_check,node_manifest,node_download,node_update_job,node_staging toneMint
class node_publisher toneRose
```

## Components

### Desktop workflow

- [Startup routing](https://github.com/emecyildiz/encryption/blob/main/main.cpp): `main.cpp`
- [File workspace](https://github.com/emecyildiz/encryption/blob/main/AppWindow.cpp): `AppWindow.cpp`
- [Batch coordination](https://github.com/emecyildiz/encryption/blob/main/batch_runner.h): `batch_runner.h`
- [Batch state](https://github.com/emecyildiz/encryption/blob/main/batch_state.h): `batch_state.h`
- [Output placement](https://github.com/emecyildiz/encryption/blob/main/output_path.h): `output_path.h`
- [Verified saving](https://github.com/emecyildiz/encryption/blob/main/verified_save.cpp): `verified_save.cpp`

### Protection and preview

- [Encryption engine](https://github.com/emecyildiz/encryption/blob/main/encryption_engine.cpp): `encryption_engine.cpp`
- [Plaintext handling](https://github.com/emecyildiz/encryption/blob/main/plaintext_output.h): `plaintext_output.h`
- [Preview window](https://github.com/emecyildiz/encryption/blob/main/PreviewWindow.cpp): `PreviewWindow.cpp`
- [Preview policy](https://github.com/emecyildiz/encryption/blob/main/preview_policy.h): `preview_policy.h`
- [Text preview](https://github.com/emecyildiz/encryption/blob/main/preview_text.cpp): `preview_text.cpp`
- [Image preview](https://github.com/emecyildiz/encryption/blob/main/preview_image.cpp): `preview_image.cpp`

### Application updates

- [Update controls](https://github.com/emecyildiz/encryption/blob/main/AppWindow.cpp): `AppWindow.cpp`
- [Release checking](https://github.com/emecyildiz/encryption/blob/main/update_check.cpp): `update_check.cpp`
- [Manifest validation](https://github.com/emecyildiz/encryption/blob/main/update_manifest.cpp): `update_manifest.cpp`
- [Bounded download](https://github.com/emecyildiz/encryption/blob/main/update_download.cpp): `update_download.cpp`
- [Update preparation](https://github.com/emecyildiz/encryption/blob/main/update_job.cpp): `update_job.cpp`
- [Installer staging](https://github.com/emecyildiz/encryption/blob/main/update_staging.cpp): `update_staging.cpp`

### Release metadata

- [Metadata publisher](https://github.com/emecyildiz/encryption/blob/main/update_publisher.cpp): `update_publisher.cpp`

### Other components

- **User**

## Connections

- User → Startup routing: launches (evidence: `README.md`)
- Startup routing → File workspace: opens (evidence: `main.cpp`)
- Startup routing → Preview window: routes preview (evidence: `main.cpp`)
- User → File workspace: selects sources (evidence: `README.md`)
- File workspace → Batch coordination: starts processing (evidence: `AppWindow.cpp`)
- File workspace → Batch state: tracks progress
- File workspace → Encryption engine: processes files
- File workspace → Output placement: chooses destination (evidence: `AppWindow.cpp`)
- File workspace → Verified saving: saves outputs (evidence: `AppWindow.cpp`)
- Encryption engine → Plaintext handling: handles plaintext (evidence: `encryption_engine.cpp`)
- Preview window → Encryption engine: decrypts preview (evidence: `PreviewWindow.cpp`)
- Preview window → Preview policy: applies limits
- Preview window → Text preview: renders text (evidence: `PreviewWindow.cpp`)
- Preview window → Image preview: renders images (evidence: `PreviewWindow.cpp`)
- User → Update controls: checks updates (evidence: `README.md`)
- Update controls → Release checking: requests check
- Release checking → Manifest validation: checks metadata
- Manifest validation → Bounded download: validates release
- Update preparation → Bounded download: prepares download
- Update preparation → Installer staging: stages installer
- Metadata publisher → Manifest validation: publishes metadata
