# salonishukla-cloud/crypto-doc-26237 architecture

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

- Interactive diagram: https://gitdiagram.com/salonishukla-cloud/crypto-doc-26237
- Repository: https://github.com/salonishukla-cloud/crypto-doc-26237

## Overview

The product is an offline confidential-document distribution and leak-attribution platform. Its documented user journey seals a document for recipients, decrypts it locally, embeds a recipient-bound watermark, records a signed event in an offline ledger, and later verifies a leak to produce an evidence report. The README supports the end-to-end flow; unsampled workflow, ledger, and UI implementation details limit claims about their internal calls.

Main entry points: [`integration/verification.rs`](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/integration/verification.rs) (Leak Verification), [`integration/workflow.rs`](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/integration/workflow.rs) (Workflow Orchestrator), [`encryption/src/encryption.rs`](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/encryption/src/encryption.rs) (Document Encryption), [`pqcrypto/src/signing.rs`](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/pqcrypto/src/signing.rs) (Event Signing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_distribution["Document Distribution"]
  node_encryption["Document Encryption<br/>[encryption.rs]"]
  node_key_management["Recipient Keys<br/>[key_manager.rs]"]
  node_package["Encrypted Package<br/>[package.rs]"]
  node_decryption["Document Decryption<br/>[decryption.rs]"]
end

subgraph group_attribution["Forensic Watermarking"]
  node_watermark_generation["Watermark Generation<br/>[generator.rs]"]
  node_watermark_embedding["Watermark Embedding<br/>[embedder.rs]"]
  node_watermark_extraction["Watermark Extraction<br/>[extractor.rs]"]
  node_watermark_validation["Watermark Validation<br/>[validator.rs]"]
end

subgraph group_crypto["Post-Quantum Identity"]
  node_event["Decryption Event<br/>[event.rs]"]
  node_canonical_serialization["Canonical Serialization<br/>[serialization.rs]"]
  node_identity["Signing Identity<br/>[identity.rs]"]
  node_signing["Event Signing<br/>[signing.rs]"]
  node_signature_verification["Signature Verification<br/>[verification.rs]"]
  node_shared_event["Shared Event Schema<br/>[event.rs]"]
end

subgraph group_ledger["Offline Ledger"]
  node_ledger[("Permissioned Ledger<br/>[dlt_client.rs]")]
  node_ledger_lookup["Ledger Lookup<br/>[ledger_index.rs]"]
end

subgraph group_station["Forensic Station"]
  node_workflow["Workflow Orchestrator<br/>[workflow.rs]"]
  node_verification["Leak Verification<br/>[verification.rs]"]
  node_report["Evidence Report<br/>[report.rs]"]
  node_station_ui["Forensic Station UI<br/>[app.js]"]
end

node_sender(("Sender"))
node_recipient(("Recipient"))
node_investigator(("Investigator"))

node_sender -->|"submits document"| node_encryption
node_encryption -->|"protects recipient keys"| node_key_management
node_encryption -->|"seals package"| node_package
node_package -->|"delivers package"| node_recipient
node_recipient -->|"requests decryption"| node_workflow
node_workflow -->|"requests decryption"| node_decryption
node_decryption -->|"generates watermark"| node_watermark_generation
node_watermark_generation -->|"provides payload"| node_watermark_embedding
node_watermark_embedding -->|"returns watermarked PDF"| node_recipient
node_workflow -->|"creates event"| node_event
node_event -->|"uses event schema"| node_shared_event
node_workflow -->|"signs event"| node_signing
node_signing -->|"signs canonical bytes"| node_canonical_serialization
node_identity -->|"provides signing key"| node_signing
node_workflow -->|"ingests signed event"| node_ledger
node_investigator -->|"submits leaked document"| node_verification
node_verification -->|"extracts watermark"| node_watermark_extraction
node_verification -->|"queries watermark hash"| node_ledger_lookup
node_ledger_lookup -->|"retrieves event receipt"| node_ledger
node_verification -->|"verifies signature"| node_signature_verification
node_verification -->|"checks watermark hash"| node_watermark_validation
node_verification -->|"generates evidence"| node_report
node_report -->|"returns report"| node_investigator
node_station_ui -.->|"dispatches workflow"| node_workflow

click node_encryption "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/encryption/src/encryption.rs"
click node_key_management "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/encryption/src/key_manager.rs"
click node_package "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/encryption/src/package.rs"
click node_decryption "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/encryption/src/decryption.rs"
click node_watermark_generation "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/watermark/src/generator.rs"
click node_watermark_embedding "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/watermark/src/embedder.rs"
click node_watermark_extraction "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/watermark/src/extractor.rs"
click node_watermark_validation "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/watermark/src/validator.rs"
click node_event "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/pqcrypto/src/event.rs"
click node_canonical_serialization "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/pqcrypto/src/serialization.rs"
click node_identity "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/pqcrypto/src/identity.rs"
click node_signing "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/pqcrypto/src/signing.rs"
click node_signature_verification "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/pqcrypto/src/verification.rs"
click node_ledger "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/ledger/client/dlt_client.rs"
click node_ledger_lookup "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/ledger/queries/ledger_index.rs"
click node_workflow "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/integration/workflow.rs"
click node_verification "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/integration/verification.rs"
click node_report "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/integration/report.rs"
click node_station_ui "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/integration/ui/app.js"
click node_shared_event "https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/shared/models/event.rs"

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_encryption,node_key_management,node_package,node_decryption toneBlue
class node_watermark_generation,node_watermark_embedding,node_watermark_extraction,node_watermark_validation toneAmber
class node_event,node_canonical_serialization,node_identity,node_signing,node_signature_verification,node_shared_event toneMint
class node_ledger,node_ledger_lookup toneRose
class node_workflow,node_verification,node_report,node_station_ui,node_sender,node_recipient,node_investigator toneIndigo
```

## Components

### Document Distribution

- [Document Encryption](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/encryption/src/encryption.rs): `encryption/src/encryption.rs`
- [Recipient Keys](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/encryption/src/key_manager.rs): `encryption/src/key_manager.rs`
- [Encrypted Package](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/encryption/src/package.rs): `encryption/src/package.rs`
- [Document Decryption](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/encryption/src/decryption.rs): `encryption/src/decryption.rs`

### Forensic Watermarking

- [Watermark Generation](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/watermark/src/generator.rs): `watermark/src/generator.rs`
- [Watermark Embedding](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/watermark/src/embedder.rs): `watermark/src/embedder.rs`
- [Watermark Extraction](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/watermark/src/extractor.rs): `watermark/src/extractor.rs`
- [Watermark Validation](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/watermark/src/validator.rs): `watermark/src/validator.rs`

### Post-Quantum Identity

- [Decryption Event](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/pqcrypto/src/event.rs): `pqcrypto/src/event.rs`
- [Canonical Serialization](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/pqcrypto/src/serialization.rs): `pqcrypto/src/serialization.rs`
- [Signing Identity](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/pqcrypto/src/identity.rs): `pqcrypto/src/identity.rs`
- [Event Signing](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/pqcrypto/src/signing.rs): `pqcrypto/src/signing.rs`
- [Signature Verification](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/pqcrypto/src/verification.rs): `pqcrypto/src/verification.rs`
- [Shared Event Schema](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/shared/models/event.rs): `shared/models/event.rs`

### Offline Ledger

- [Permissioned Ledger](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/ledger/client/dlt_client.rs): `ledger/client/dlt_client.rs`
- [Ledger Lookup](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/ledger/queries/ledger_index.rs): `ledger/queries/ledger_index.rs`

### Forensic Station

- [Workflow Orchestrator](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/integration/workflow.rs): `integration/workflow.rs`
- [Leak Verification](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/integration/verification.rs): `integration/verification.rs`
- [Evidence Report](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/integration/report.rs): `integration/report.rs`
- [Forensic Station UI](https://github.com/salonishukla-cloud/crypto-doc-26237/blob/main/integration/ui/app.js): `integration/ui/app.js`

### Other components

- **Sender**
- **Recipient**
- **Investigator**

## Connections

- Sender → Document Encryption: submits document (evidence: `README.md`)
- Document Encryption → Recipient Keys: protects recipient keys (evidence: `README.md`)
- Document Encryption → Encrypted Package: seals package (evidence: `README.md`)
- Encrypted Package → Recipient: delivers package (evidence: `README.md`)
- Recipient → Workflow Orchestrator: requests decryption (evidence: `README.md`)
- Workflow Orchestrator → Document Decryption: requests decryption (evidence: `README.md`)
- Document Decryption → Watermark Generation: generates watermark (evidence: `README.md`)
- Watermark Generation → Watermark Embedding: provides payload (evidence: `README.md`)
- Watermark Embedding → Recipient: returns watermarked PDF (evidence: `README.md`)
- Workflow Orchestrator → Decryption Event: creates event (evidence: `README.md`)
- Decryption Event → Shared Event Schema: uses event schema (evidence: `README.md`)
- Workflow Orchestrator → Event Signing: signs event (evidence: `README.md`)
- Event Signing → Canonical Serialization: signs canonical bytes (evidence: `pqcrypto/src/signing.rs`)
- Signing Identity → Event Signing: provides signing key (evidence: `pqcrypto/src/signing.rs`)
- Workflow Orchestrator → Permissioned Ledger: ingests signed event (evidence: `README.md`)
- Investigator → Leak Verification: submits leaked document (evidence: `README.md`)
- Leak Verification → Watermark Extraction: extracts watermark (evidence: `README.md`)
- Leak Verification → Ledger Lookup: queries watermark hash (evidence: `README.md`)
- Ledger Lookup → Permissioned Ledger: retrieves event receipt (evidence: `README.md`)
- Leak Verification → Signature Verification: verifies signature (evidence: `README.md`)
- Leak Verification → Watermark Validation: checks watermark hash (evidence: `README.md`)
- Leak Verification → Evidence Report: generates evidence (evidence: `README.md`)
- Evidence Report → Investigator: returns report (evidence: `README.md`)
- Forensic Station UI → Workflow Orchestrator: dispatches workflow
