# landeyucc/venc architecture

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

- Interactive diagram: https://gitdiagram.com/landeyucc/venc
- Repository: https://github.com/landeyucc/venc

## Overview

VENC is a browser-based file encryption tool, with a separate Node.js CLI for compatible file operations and an optional Cloudflare KV logging/admin backend. The main user flow selects a file and credentials, processes encryption or decryption in a Web Worker, verifies decrypted content, then offers the result for download. The graph also preserves localization and the documented logging/configuration capability. Evidence is limited to the supplied excerpts and README; unsampled wiring is omitted where it cannot be established.

Main entry points: [`js/main.js`](https://github.com/landeyucc/venc/blob/main/js/main.js) (Workflow controller), [`js/cryptoWorker.js`](https://github.com/landeyucc/venc/blob/main/js/cryptoWorker.js) (Crypto worker), [`index.html`](https://github.com/landeyucc/venc/blob/main/index.html) (Encryption interface), [`js/i18n.js`](https://github.com/landeyucc/venc/blob/main/js/i18n.js) (Localization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser application"]
  node_webpage["Encryption interface<br/>[index.html]"]
  node_main["Workflow controller<br/>[main.js]"]
  node_i18n["Localization<br/>[i18n.js]"]
  node_translations["Language packs<br/>[en-US.js]"]
  node_footer["Footer behavior<br/>[footer.js]"]
  node_fileinput["File selection<br/>[main.js]"]
  node_cache["File cache<br/>[main.js]"]
  node_downloads["Result downloads<br/>[main.js]"]
  node_settings["Log and app settings<br/>[main.js]"]
end

subgraph group_crypto["File protection"]
  node_worker["Crypto worker<br/>[cryptoWorker.js]"]
  node_encryption["AES-GCM encryption<br/>[cryptoWorker.js]"]
  node_keyrecovery["Password and recovery keys<br/>[cryptoWorker.js]"]
  node_fileformat["VENC file format<br/>[cryptoWorker.js]"]
  node_integrity["Integrity verification<br/>[cryptoWorker.js]"]
end

subgraph group_cli["Command-line tool"]
  node_clientry["CLI entry point<br/>[cli.js]"]
  node_clicommands["CLI commands<br/>[cli.js]"]
end

subgraph group_backend["Log backend"]
  node_logservice["Log API<br/>[worker.js]"]
  node_admin["Log administration<br/>[worker.js]"]
  node_kv[("Cloudflare KV")]
end

node_user(("User"))
node_browser(("Browser runtime"))

node_user -->|"opens app"| node_webpage
node_webpage -.->|"loads workflow"| node_main
node_main -->|"initializes translations"| node_i18n
node_i18n -->|"loads language packs"| node_translations
node_user -->|"selects file"| node_fileinput
node_main -->|"reads selected file"| node_fileinput
node_main -->|"caches file data"| node_cache
node_main -->|"sends crypto job"| node_worker
node_worker -->|"encrypts or decrypts"| node_encryption
node_worker -->|"derives or recovers key"| node_keyrecovery
node_worker -->|"builds or parses"| node_fileformat
node_worker -->|"checks file hash"| node_integrity
node_worker -->|"returns progress and result"| node_main
node_main -->|"offers result files"| node_downloads
node_user -->|"runs command"| node_clientry
node_clientry -->|"loads CLI"| node_clicommands
node_user -->|"configures logging"| node_settings
node_settings -.->|"sends configured logs"| node_logservice
node_user -.->|"manages log entries"| node_admin
node_logservice -->|"reads and writes"| node_kv
node_admin -->|"manages entries"| node_kv
node_browser -.->|"runs page script"| node_footer

click node_webpage "https://github.com/landeyucc/venc/blob/main/index.html"
click node_main "https://github.com/landeyucc/venc/blob/main/js/main.js"
click node_i18n "https://github.com/landeyucc/venc/blob/main/js/i18n.js"
click node_translations "https://github.com/landeyucc/venc/blob/main/lang/en-US.js"
click node_footer "https://github.com/landeyucc/venc/blob/main/js/footer.js"
click node_fileinput "https://github.com/landeyucc/venc/blob/main/js/main.js"
click node_cache "https://github.com/landeyucc/venc/blob/main/js/main.js"
click node_worker "https://github.com/landeyucc/venc/blob/main/js/cryptoWorker.js"
click node_encryption "https://github.com/landeyucc/venc/blob/main/js/cryptoWorker.js"
click node_keyrecovery "https://github.com/landeyucc/venc/blob/main/js/cryptoWorker.js"
click node_fileformat "https://github.com/landeyucc/venc/blob/main/js/cryptoWorker.js"
click node_integrity "https://github.com/landeyucc/venc/blob/main/js/cryptoWorker.js"
click node_downloads "https://github.com/landeyucc/venc/blob/main/js/main.js"
click node_clientry "https://github.com/landeyucc/venc/blob/main/cli.js"
click node_clicommands "https://github.com/landeyucc/venc/blob/main/cli/cli.js"
click node_settings "https://github.com/landeyucc/venc/blob/main/js/main.js"
click node_logservice "https://github.com/landeyucc/venc/blob/main/cloudflare_backend/worker.js"
click node_admin "https://github.com/landeyucc/venc/blob/main/cloudflare_backend/worker.js"

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_webpage,node_main,node_i18n,node_translations,node_footer,node_fileinput,node_cache,node_downloads,node_settings,node_user,node_browser toneBlue
class node_worker,node_encryption,node_keyrecovery,node_fileformat,node_integrity toneAmber
class node_clientry,node_clicommands toneMint
class node_logservice,node_admin,node_kv toneRose
```

## Components

### Browser application

- [Encryption interface](https://github.com/landeyucc/venc/blob/main/index.html): `index.html`
- [Workflow controller](https://github.com/landeyucc/venc/blob/main/js/main.js): `js/main.js`
- [Localization](https://github.com/landeyucc/venc/blob/main/js/i18n.js): `js/i18n.js`
- [Language packs](https://github.com/landeyucc/venc/blob/main/lang/en-US.js): `lang/en-US.js`
- [Footer behavior](https://github.com/landeyucc/venc/blob/main/js/footer.js): `js/footer.js`
- [File selection](https://github.com/landeyucc/venc/blob/main/js/main.js): `js/main.js`
- [File cache](https://github.com/landeyucc/venc/blob/main/js/main.js): `js/main.js`
- [Result downloads](https://github.com/landeyucc/venc/blob/main/js/main.js): `js/main.js`
- [Log and app settings](https://github.com/landeyucc/venc/blob/main/js/main.js): `js/main.js`

### File protection

- [Crypto worker](https://github.com/landeyucc/venc/blob/main/js/cryptoWorker.js): `js/cryptoWorker.js`
- [AES-GCM encryption](https://github.com/landeyucc/venc/blob/main/js/cryptoWorker.js): `js/cryptoWorker.js`
- [Password and recovery keys](https://github.com/landeyucc/venc/blob/main/js/cryptoWorker.js): `js/cryptoWorker.js`
- [VENC file format](https://github.com/landeyucc/venc/blob/main/js/cryptoWorker.js): `js/cryptoWorker.js`
- [Integrity verification](https://github.com/landeyucc/venc/blob/main/js/cryptoWorker.js): `js/cryptoWorker.js`

### Command-line tool

- [CLI entry point](https://github.com/landeyucc/venc/blob/main/cli.js): `cli.js`
- [CLI commands](https://github.com/landeyucc/venc/blob/main/cli/cli.js): `cli/cli.js`

### Log backend

- [Log API](https://github.com/landeyucc/venc/blob/main/cloudflare_backend/worker.js): `cloudflare_backend/worker.js`
- [Log administration](https://github.com/landeyucc/venc/blob/main/cloudflare_backend/worker.js): `cloudflare_backend/worker.js`
- **Cloudflare KV**

### Other components

- **User**
- **Browser runtime**

## Connections

- User → Encryption interface: opens app (evidence: `README.md`)
- Encryption interface → Workflow controller: loads workflow
- Workflow controller → Localization: initializes translations (evidence: `js/main.js`)
- Localization → Language packs: loads language packs (evidence: `js/i18n.js`)
- User → File selection: selects file (evidence: `README.md`)
- Workflow controller → File selection: reads selected file (evidence: `js/main.js`)
- Workflow controller → File cache: caches file data (evidence: `js/main.js`)
- Workflow controller → Crypto worker: sends crypto job (evidence: `js/main.js`)
- Crypto worker → AES-GCM encryption: encrypts or decrypts (evidence: `js/cryptoWorker.js`)
- Crypto worker → Password and recovery keys: derives or recovers key (evidence: `js/cryptoWorker.js`)
- Crypto worker → VENC file format: builds or parses (evidence: `js/cryptoWorker.js`)
- Crypto worker → Integrity verification: checks file hash (evidence: `js/cryptoWorker.js`)
- Crypto worker → Workflow controller: returns progress and result (evidence: `js/main.js`)
- Workflow controller → Result downloads: offers result files (evidence: `README.md`)
- User → CLI entry point: runs command (evidence: `cli.js`)
- CLI entry point → CLI commands: loads CLI (evidence: `cli.js`)
- User → Log and app settings: configures logging (evidence: `README.md`)
- Log and app settings → Log API: sends configured logs
- User → Log administration: manages log entries
- Log API → Cloudflare KV: reads and writes (evidence: `cloudflare_backend/worker.js`)
- Log administration → Cloudflare KV: manages entries (evidence: `cloudflare_backend/worker.js`)
- Browser runtime → Footer behavior: runs page script
