# sup1118/final architecture

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

- Interactive diagram: https://gitdiagram.com/sup1118/final
- Repository: https://github.com/sup1118/final

## Overview

cryptography1 is a browser-based image steganography sandbox: a user loads an image, hides or reads a text message in its RGB least-significant bits, inspects a visual difference map, and can download the encoded image. The UI handles image and canvas state, actions, diagnostics, and export; crypto.js provides the encoding and decoding logic. The README contains only the project name, so capabilities here are based on the supplied source excerpts; index.html and style.css were not sampled.

Main entry points: [`ui.js`](https://github.com/sup1118/final/blob/main/ui.js) (Message Actions), [`crypto.js`](https://github.com/sup1118/final/blob/main/crypto.js) (LSB Codec)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Browser Interface"]
  node_image["Image Workspace<br/>[ui.js]"]
  node_actions["Message Actions<br/>[ui.js]"]
  node_difference["Difference View<br/>[ui.js]"]
  node_export["Image Export<br/>[ui.js]"]
end

subgraph group_steganography["Steganography Core"]
  node_codec["LSB Codec<br/>[crypto.js]"]
end

node_user(("User"))
node_browser["Browser APIs"]

node_user -->|"selects image"| node_image
node_user -->|"requests encode/decode"| node_actions
node_user -->|"requests download"| node_export
node_image -->|"reads and draws"| node_browser
node_actions -->|"encodes or decodes"| node_codec
node_actions -->|"generates map"| node_difference
node_export -->|"downloads canvas"| node_browser

click node_image "https://github.com/sup1118/final/blob/main/ui.js"
click node_actions "https://github.com/sup1118/final/blob/main/ui.js"
click node_difference "https://github.com/sup1118/final/blob/main/ui.js"
click node_export "https://github.com/sup1118/final/blob/main/ui.js"
click node_codec "https://github.com/sup1118/final/blob/main/crypto.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_image,node_actions,node_difference,node_export,node_user,node_browser toneBlue
class node_codec toneAmber
```

## Components

### Browser Interface

- [Image Workspace](https://github.com/sup1118/final/blob/main/ui.js): `ui.js`
- [Message Actions](https://github.com/sup1118/final/blob/main/ui.js): `ui.js`
- [Difference View](https://github.com/sup1118/final/blob/main/ui.js): `ui.js`
- [Image Export](https://github.com/sup1118/final/blob/main/ui.js): `ui.js`

### Steganography Core

- [LSB Codec](https://github.com/sup1118/final/blob/main/crypto.js): `crypto.js`

### Other components

- **User**
- **Browser APIs**

## Connections

- User → Image Workspace: selects image (evidence: `ui.js`)
- User → Message Actions: requests encode/decode (evidence: `ui.js`)
- User → Image Export: requests download (evidence: `ui.js`)
- Image Workspace → Browser APIs: reads and draws (evidence: `ui.js`)
- Message Actions → LSB Codec: encodes or decodes (evidence: `ui.js`)
- Message Actions → Difference View: generates map (evidence: `ui.js`)
- Image Export → Browser APIs: downloads canvas (evidence: `ui.js`)
