# gchq/cyberchef architecture

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

- Interactive diagram: https://gitdiagram.com/gchq/cyberchef
- Repository: https://github.com/gchq/cyberchef
- Video tour (about a minute): https://gitdiagram.com/gchq/cyberchef/video

## Overview

CyberChef is a browser-based data transformation workbench, with a parallel Node.js API. In the browser, an analyst supplies input, builds a recipe from searchable operations, and bakes it to view or save output; recipes can also be shared through URLs or saved locally. The core models typed data and operations, while web workers keep processing off the UI thread. The README documents broad encoding, cryptography, compression, parsing, and analysis capabilities. Some UI waiters and recipe internals were not sampled, so their detailed interactions are not expanded.

Main entry points: [`src/web/Manager.mjs`](https://github.com/gchq/cyberchef/blob/master/src/web/Manager.mjs) (Event Manager), [`src/node/api.mjs`](https://github.com/gchq/cyberchef/blob/master/src/node/api.mjs) (Node API), [`src/web/waiters/OutputWaiter.mjs`](https://github.com/gchq/cyberchef/blob/master/src/web/waiters/OutputWaiter.mjs) (Output Display), [`src/core/Dish.mjs`](https://github.com/gchq/cyberchef/blob/master/src/core/Dish.mjs) (Typed Data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser Workbench"]
  node_app["Workbench UI<br/>[App.mjs]"]
  node_manager["Event Manager<br/>[Manager.mjs]"]
  node_recipe_ui["Recipe Editor<br/>[RecipeWaiter.mjs]"]
  node_input_ui["Input Handling<br/>[InputWaiter.mjs]"]
  node_output_ui["Output Display<br/>[OutputWaiter.mjs]"]
  node_status["Status Display<br/>[statusBar.mjs]"]
  node_workers_ui["Worker Control<br/>[WorkerWaiter.mjs]"]
end

subgraph group_runtime["Processing Runtime"]
  node_chef_worker["Bake Worker<br/>[ChefWorker.js]"]
  node_chef["Recipe Executor<br/>[Chef.mjs]"]
  node_recipe["Recipe Model<br/>[Recipe.mjs]"]
  node_operation["Operation Model<br/>[Operation.mjs]"]
  node_dish["Typed Data<br/>[Dish.mjs]"]
  node_dish_worker["Data Conversion Worker<br/>[DishWorker.mjs]"]
end

subgraph group_operations["Operation Library"]
  node_operations["Transformations"]
  node_algorithms["Algorithm Libraries"]
end

subgraph group_node["Node Interface"]
  node_node_api["Node API<br/>[api.mjs]"]
  node_node_recipe["Node Recipe<br/>[NodeRecipe.mjs]"]
  node_node_dish["Node Data<br/>[NodeDish.mjs]"]
end

node_analyst(("Analyst"))
node_local_storage[("Browser Local Storage")]

node_analyst -->|"uses"| node_app
node_app -->|"initializes"| node_manager
node_manager -->|"sets up"| node_input_ui
node_manager -->|"initializes"| node_recipe_ui
node_manager -->|"sets up"| node_workers_ui
node_manager -.->|"coordinates"| node_output_ui
node_analyst -->|"provides data"| node_input_ui
node_analyst -->|"builds recipe"| node_recipe_ui
node_analyst -->|"views result"| node_output_ui
node_analyst -->|"saves recipe"| node_local_storage
node_workers_ui -->|"dispatches bake"| node_chef_worker
node_chef_worker -->|"executes request"| node_chef
node_chef -->|"uses recipe model"| node_recipe
node_chef -->|"uses data model"| node_dish
node_operation -->|"uses data model"| node_dish
node_dish -->|"detects file type"| node_algorithms
node_output_ui -->|"updates status"| node_status
node_output_ui -->|"converts output"| node_dish
node_input_ui -.->|"requests conversion"| node_dish_worker
node_node_api -->|"creates recipe"| node_node_recipe
node_node_api -->|"wraps data"| node_node_dish
node_node_recipe -->|"uses API utilities"| node_node_api
node_node_api -.->|"returns result"| node_analyst

click node_app "https://github.com/gchq/cyberchef/blob/master/src/web/App.mjs"
click node_manager "https://github.com/gchq/cyberchef/blob/master/src/web/Manager.mjs"
click node_recipe_ui "https://github.com/gchq/cyberchef/blob/master/src/web/waiters/RecipeWaiter.mjs"
click node_input_ui "https://github.com/gchq/cyberchef/blob/master/src/web/waiters/InputWaiter.mjs"
click node_output_ui "https://github.com/gchq/cyberchef/blob/master/src/web/waiters/OutputWaiter.mjs"
click node_status "https://github.com/gchq/cyberchef/blob/master/src/web/utils/statusBar.mjs"
click node_workers_ui "https://github.com/gchq/cyberchef/blob/master/src/web/waiters/WorkerWaiter.mjs"
click node_chef_worker "https://github.com/gchq/cyberchef/blob/master/src/core/ChefWorker.js"
click node_chef "https://github.com/gchq/cyberchef/blob/master/src/core/Chef.mjs"
click node_recipe "https://github.com/gchq/cyberchef/blob/master/src/core/Recipe.mjs"
click node_operation "https://github.com/gchq/cyberchef/blob/master/src/core/Operation.mjs"
click node_dish "https://github.com/gchq/cyberchef/blob/master/src/core/Dish.mjs"
click node_dish_worker "https://github.com/gchq/cyberchef/blob/master/src/web/workers/DishWorker.mjs"
click node_operations "https://github.com/gchq/cyberchef/tree/master/src/core/operations"
click node_algorithms "https://github.com/gchq/cyberchef/tree/master/src/core/lib"
click node_node_api "https://github.com/gchq/cyberchef/blob/master/src/node/api.mjs"
click node_node_recipe "https://github.com/gchq/cyberchef/blob/master/src/node/NodeRecipe.mjs"
click node_node_dish "https://github.com/gchq/cyberchef/blob/master/src/node/NodeDish.mjs"

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_manager,node_recipe_ui,node_input_ui,node_output_ui,node_status,node_workers_ui toneBlue
class node_chef_worker,node_chef,node_recipe,node_operation,node_dish,node_dish_worker,node_local_storage toneAmber
class node_operations,node_algorithms toneMint
class node_node_api,node_node_recipe,node_node_dish toneRose
class node_analyst toneIndigo
```

## Components

### Browser Workbench

- [Workbench UI](https://github.com/gchq/cyberchef/blob/master/src/web/App.mjs): `src/web/App.mjs`
- [Event Manager](https://github.com/gchq/cyberchef/blob/master/src/web/Manager.mjs): `src/web/Manager.mjs`
- [Recipe Editor](https://github.com/gchq/cyberchef/blob/master/src/web/waiters/RecipeWaiter.mjs): `src/web/waiters/RecipeWaiter.mjs`
- [Input Handling](https://github.com/gchq/cyberchef/blob/master/src/web/waiters/InputWaiter.mjs): `src/web/waiters/InputWaiter.mjs`
- [Output Display](https://github.com/gchq/cyberchef/blob/master/src/web/waiters/OutputWaiter.mjs): `src/web/waiters/OutputWaiter.mjs`
- [Status Display](https://github.com/gchq/cyberchef/blob/master/src/web/utils/statusBar.mjs): `src/web/utils/statusBar.mjs`
- [Worker Control](https://github.com/gchq/cyberchef/blob/master/src/web/waiters/WorkerWaiter.mjs): `src/web/waiters/WorkerWaiter.mjs`

### Processing Runtime

- [Bake Worker](https://github.com/gchq/cyberchef/blob/master/src/core/ChefWorker.js): `src/core/ChefWorker.js`
- [Recipe Executor](https://github.com/gchq/cyberchef/blob/master/src/core/Chef.mjs): `src/core/Chef.mjs`
- [Recipe Model](https://github.com/gchq/cyberchef/blob/master/src/core/Recipe.mjs): `src/core/Recipe.mjs`
- [Operation Model](https://github.com/gchq/cyberchef/blob/master/src/core/Operation.mjs): `src/core/Operation.mjs`
- [Typed Data](https://github.com/gchq/cyberchef/blob/master/src/core/Dish.mjs): `src/core/Dish.mjs`
- [Data Conversion Worker](https://github.com/gchq/cyberchef/blob/master/src/web/workers/DishWorker.mjs): `src/web/workers/DishWorker.mjs`

### Operation Library

- [Transformations](https://github.com/gchq/cyberchef/tree/master/src/core/operations): `src/core/operations`
- [Algorithm Libraries](https://github.com/gchq/cyberchef/tree/master/src/core/lib): `src/core/lib`

### Node Interface

- [Node API](https://github.com/gchq/cyberchef/blob/master/src/node/api.mjs): `src/node/api.mjs`
- [Node Recipe](https://github.com/gchq/cyberchef/blob/master/src/node/NodeRecipe.mjs): `src/node/NodeRecipe.mjs`
- [Node Data](https://github.com/gchq/cyberchef/blob/master/src/node/NodeDish.mjs): `src/node/NodeDish.mjs`

### Other components

- **Analyst**
- **Browser Local Storage**

## Connections

- Analyst → Workbench UI: uses (evidence: `README.md`)
- Workbench UI → Event Manager: initializes (evidence: `src/web/App.mjs`)
- Event Manager → Input Handling: sets up (evidence: `src/web/Manager.mjs`)
- Event Manager → Recipe Editor: initializes (evidence: `src/web/Manager.mjs`)
- Event Manager → Worker Control: sets up (evidence: `src/web/Manager.mjs`)
- Event Manager → Output Display: coordinates (evidence: `src/web/Manager.mjs`)
- Analyst → Input Handling: provides data (evidence: `README.md`)
- Analyst → Recipe Editor: builds recipe (evidence: `README.md`)
- Analyst → Output Display: views result (evidence: `README.md`)
- Analyst → Browser Local Storage: saves recipe (evidence: `README.md`)
- Worker Control → Bake Worker: dispatches bake (evidence: `src/web/waiters/WorkerWaiter.mjs`)
- Bake Worker → Recipe Executor: executes request (evidence: `src/core/ChefWorker.js`)
- Recipe Executor → Recipe Model: uses recipe model (evidence: `src/core/Chef.mjs`)
- Recipe Executor → Typed Data: uses data model (evidence: `src/core/Chef.mjs`)
- Operation Model → Typed Data: uses data model (evidence: `src/core/Operation.mjs`)
- Typed Data → Algorithm Libraries: detects file type (evidence: `src/core/Dish.mjs`)
- Output Display → Status Display: updates status (evidence: `src/web/waiters/OutputWaiter.mjs`)
- Output Display → Typed Data: converts output (evidence: `src/web/waiters/OutputWaiter.mjs`)
- Input Handling → Data Conversion Worker: requests conversion
- Node API → Node Recipe: creates recipe (evidence: `src/node/api.mjs`)
- Node API → Node Data: wraps data (evidence: `src/node/api.mjs`)
- Node Recipe → Node API: uses API utilities (evidence: `src/node/NodeRecipe.mjs`)
- Node API → Analyst: returns result
