# thesourcebuild/cipherworkbench architecture

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

- Interactive diagram: https://gitdiagram.com/thesourcebuild/cipherworkbench
- Repository: https://github.com/thesourcebuild/cipherworkbench

## Overview

Cipher Workbench is a local-first cryptography suite for browser and Electron users. The main workflow is selecting a tool, supplying and configuring input, running a tool-family computation, then inspecting or verifying the result. Its architecture combines a shared tool registry and execution engine with algorithm packages, specialized certificate/PKI operations, and platform adapters. The README documents the broad tool families and offline execution; edges based on unsampled subsystems are included only where that documentation supports the relationship.

Main entry points: [`apps/web/app/tool-workbench.tsx`](https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/tool-workbench.tsx) (Tool workbench), [`apps/web/app/app-shell.tsx`](https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/app-shell.tsx) (Workbench shell), [`packages/tools/certificates/src/compute.ts`](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/certificates/src/compute.ts) (Certificate operations), [`packages/tools/certificates/src/asn1/chain-verifier.ts`](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/certificates/src/asn1/chain-verifier.ts) (Chain verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Workbench experience"]
  node_shell["Workbench shell<br/>[app-shell.tsx]"]
  node_sidebar["Tool navigation<br/>[sidebar.tsx]"]
  node_workbench["Tool workbench<br/>[tool-workbench.tsx]"]
  node_input["Input and options<br/>[input-panel.tsx]"]
  node_results["Results and verification<br/>[result-panel.tsx]"]
end

subgraph group_runtime["Shared runtime"]
  node_registry["Tool registry<br/>[index.ts]"]
  node_engine["Tool definitions<br/>[tool-definition.ts]"]
  node_codec["Input codecs<br/>[bytes.ts]"]
  node_textcodec["Text encodings<br/>[text.ts]"]
  node_platform["Platform adapter<br/>[web.ts]"]
end

subgraph group_tooling["Tool families"]
  node_crypto["Hashes, ciphers, KDFs<br/>[bindings.ts]"]
  node_otherfamilies["Other tool families<br/>[compute.ts]"]
  node_crc["CRC computation<br/>[engine.ts]"]
end

subgraph group_pki["Certificates and PKI"]
  node_certcompute["Certificate operations<br/>[compute.ts]"]
  node_asn1["ASN.1 parsing<br/>[asn1.ts]"]
  node_x509["X.509 parsing<br/>[x509.ts]"]
  node_chain["Chain verification<br/>[chain-verifier.ts]"]
end

subgraph group_platforms["Platform shells"]
  node_web["Web app<br/>[page.tsx]"]
  node_desktop["Electron shell<br/>[index.ts]"]
  node_protocol["App protocol<br/>[protocol.ts]"]
end

node_user(("Developer"))

node_user -->|"opens suite"| node_web
node_web -->|"renders"| node_shell
node_shell -->|"shows navigation"| node_sidebar
node_shell -->|"shows selected tool"| node_workbench
node_sidebar -->|"selects tool"| node_shell
node_workbench -.->|"collects input"| node_input
node_workbench -.->|"loads tool"| node_registry
node_registry -->|"uses manifests"| node_engine
node_input -->|"encodes input"| node_codec
node_codec -->|"decodes text"| node_textcodec
node_workbench -->|"runs operation"| node_crypto
node_workbench -->|"runs operation"| node_otherfamilies
node_workbench -->|"runs operation"| node_crc
node_workbench -->|"runs operation"| node_certcompute
node_workbench -.->|"presents result"| node_results
node_certcompute -->|"parses artifacts"| node_asn1
node_certcompute -->|"uses X.509 tools"| node_x509
node_certcompute -->|"verifies chains"| node_chain
node_chain -->|"parses DER"| node_asn1
node_chain -->|"parses certificates"| node_x509
node_shell -->|"uses adapter"| node_platform
node_user -->|"opens suite"| node_desktop
node_desktop -->|"serves app origin"| node_protocol
node_desktop -->|"loads shared UI"| node_web

click node_web "https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/page.tsx"
click node_shell "https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/app-shell.tsx"
click node_sidebar "https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/sidebar.tsx"
click node_workbench "https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/tool-workbench.tsx"
click node_input "https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/input-panel.tsx"
click node_results "https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/result-panel.tsx"
click node_registry "https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/cipher-registry/src/index.ts"
click node_engine "https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/cipher-engine/src/tool-definition.ts"
click node_codec "https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/cipher-engine/src/codec/bytes.ts"
click node_textcodec "https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/cipher-engine/src/codec/text.ts"
click node_platform "https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/platform/src/web.ts"
click node_crypto "https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/hash/src/bindings.ts"
click node_otherfamilies "https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/asymmetric/src/compute.ts"
click node_crc "https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/algos/src/crc/engine.ts"
click node_certcompute "https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/certificates/src/compute.ts"
click node_asn1 "https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/certificates/src/asn1/asn1.ts"
click node_x509 "https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/certificates/src/asn1/x509.ts"
click node_chain "https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/certificates/src/asn1/chain-verifier.ts"
click node_desktop "https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/desktop/src/main/index.ts"
click node_protocol "https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/desktop/src/main/protocol.ts"

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_shell,node_sidebar,node_workbench,node_input,node_results toneBlue
class node_registry,node_engine,node_codec,node_textcodec,node_platform toneAmber
class node_crypto,node_otherfamilies,node_crc toneMint
class node_certcompute,node_asn1,node_x509,node_chain toneRose
class node_web,node_desktop,node_protocol,node_user toneIndigo
```

## Components

### Workbench experience

- [Workbench shell](https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/app-shell.tsx): `apps/web/app/app-shell.tsx`
- [Tool navigation](https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/sidebar.tsx): `apps/web/app/sidebar.tsx`
- [Tool workbench](https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/tool-workbench.tsx): `apps/web/app/tool-workbench.tsx`
- [Input and options](https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/input-panel.tsx): `apps/web/app/input-panel.tsx`
- [Results and verification](https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/result-panel.tsx): `apps/web/app/result-panel.tsx`

### Shared runtime

- [Tool registry](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/cipher-registry/src/index.ts): `packages/cipher-registry/src/index.ts`
- [Tool definitions](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/cipher-engine/src/tool-definition.ts): `packages/cipher-engine/src/tool-definition.ts`
- [Input codecs](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/cipher-engine/src/codec/bytes.ts): `packages/cipher-engine/src/codec/bytes.ts`
- [Text encodings](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/cipher-engine/src/codec/text.ts): `packages/cipher-engine/src/codec/text.ts`
- [Platform adapter](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/platform/src/web.ts): `packages/platform/src/web.ts`

### Tool families

- [Hashes, ciphers, KDFs](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/hash/src/bindings.ts): `packages/tools/hash/src/bindings.ts`
- [Other tool families](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/asymmetric/src/compute.ts): `packages/tools/asymmetric/src/compute.ts`
- [CRC computation](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/algos/src/crc/engine.ts): `packages/algos/src/crc/engine.ts`

### Certificates and PKI

- [Certificate operations](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/certificates/src/compute.ts): `packages/tools/certificates/src/compute.ts`
- [ASN.1 parsing](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/certificates/src/asn1/asn1.ts): `packages/tools/certificates/src/asn1/asn1.ts`
- [X.509 parsing](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/certificates/src/asn1/x509.ts): `packages/tools/certificates/src/asn1/x509.ts`
- [Chain verification](https://github.com/thesourcebuild/cipherworkbench/blob/master/packages/tools/certificates/src/asn1/chain-verifier.ts): `packages/tools/certificates/src/asn1/chain-verifier.ts`

### Platform shells

- [Web app](https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/web/app/page.tsx): `apps/web/app/page.tsx`
- [Electron shell](https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/desktop/src/main/index.ts): `apps/desktop/src/main/index.ts`
- [App protocol](https://github.com/thesourcebuild/cipherworkbench/blob/master/apps/desktop/src/main/protocol.ts): `apps/desktop/src/main/protocol.ts`

### Other components

- **Developer**

## Connections

- Developer → Web app: opens suite
- Web app → Workbench shell: renders (evidence: `apps/web/app/page.tsx`)
- Workbench shell → Tool navigation: shows navigation (evidence: `apps/web/app/app-shell.tsx`)
- Workbench shell → Tool workbench: shows selected tool (evidence: `apps/web/app/app-shell.tsx`)
- Tool navigation → Workbench shell: selects tool (evidence: `apps/web/app/app-shell.tsx`)
- Tool workbench → Input and options: collects input
- Tool workbench → Tool registry: loads tool
- Tool registry → Tool definitions: uses manifests
- Input and options → Input codecs: encodes input
- Input codecs → Text encodings: decodes text (evidence: `packages/cipher-engine/src/codec/bytes.ts`)
- Tool workbench → Hashes, ciphers, KDFs: runs operation
- Tool workbench → Other tool families: runs operation
- Tool workbench → CRC computation: runs operation
- Tool workbench → Certificate operations: runs operation
- Tool workbench → Results and verification: presents result
- Certificate operations → ASN.1 parsing: parses artifacts (evidence: `packages/tools/certificates/src/compute.ts`)
- Certificate operations → X.509 parsing: uses X.509 tools (evidence: `packages/tools/certificates/src/compute.ts`)
- Certificate operations → Chain verification: verifies chains (evidence: `packages/tools/certificates/src/compute.ts`)
- Chain verification → ASN.1 parsing: parses DER (evidence: `packages/tools/certificates/src/asn1/chain-verifier.ts`)
- Chain verification → X.509 parsing: parses certificates (evidence: `packages/tools/certificates/src/asn1/chain-verifier.ts`)
- Workbench shell → Platform adapter: uses adapter (evidence: `apps/web/app/app-shell.tsx`)
- Developer → Electron shell: opens suite
- Electron shell → App protocol: serves app origin (evidence: `apps/desktop/src/main/index.ts`)
- Electron shell → Web app: loads shared UI
