# tristan-h11/kryptographie architecture

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

- Interactive diagram: https://gitdiagram.com/tristan-h11/kryptographie
- Repository: https://github.com/tristan-h11/kryptographie

## Overview

Kryptographie is an academic cryptography learning application: an Angular GUI presents RSA, Menezes–Vanstone, and mathematical demonstrations, while a Rust backend provides cryptographic and math operations. The main workflow is a user action in an algorithm panel, an HTTP request, backend endpoint handling, and a cryptographic operation; GUI-to-backend links are dashed because the supplied excerpts do not show the URL mapping or server-side dispatch. The README also documents ElGamal derivatives and elliptic-curve work, so those capabilities are retained despite limited implementation excerpts.

Main entry points: [`src/math_core/number_theory/number_theory_service.rs`](https://github.com/tristan-h11/kryptographie/blob/master/src/math_core/number_theory/number_theory_service.rs) (Number theory services), [`GUI/src/app/app.component.ts`](https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/app.component.ts) (Application shell), [`src/api/endpoints/rsa.rs`](https://github.com/tristan-h11/kryptographie/blob/master/src/api/endpoints/rsa.rs) (RSA endpoints), [`GUI/src/app/encryption-components/rsa/rsa-client-panel/rsa-client-panel.component.ts`](https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/encryption-components/rsa/rsa-client-panel/rsa-client-panel.component.ts) (RSA client actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gui["Learning interface"]
  node_app["Application shell<br/>[app.component.ts]"]
  node_rsa_ui["RSA workspace"]
  node_mv_ui["Menezes–Vanstone workspace"]
  node_math_ui["Math demonstrations"]
  node_curve_ui["Curve display"]
  node_client_state["Client and message state<br/>[ClientData.ts]"]
  node_rsa_client["RSA client actions"]
  node_mv_client["MV client actions"]
end

subgraph group_api["Backend API"]
  node_api_routes["API route setup<br/>[basic.rs]"]
  node_rsa_api["RSA endpoints<br/>[rsa.rs]"]
  node_mv_api["MV endpoints<br/>[mv.rs]"]
  node_math_api["Math endpoints<br/>[math_endpoints.rs]"]
  node_serial_models["Serializable API models"]
end

subgraph group_crypto["Cryptographic schemes"]
  node_rsa_string["RSA string encryption and signatures"]
  node_rsa_core["RSA core scheme<br/>[rsa_scheme.rs]"]
  node_mv_scheme["Menezes–Vanstone scheme"]
  node_elgamal["ElGamal variants"]
  node_ggh["GGH integer scheme<br/>[ggh_integer.rs]"]
  node_string_conversion["Decimal Unicode conversion"]
end

subgraph group_math["Math foundations"]
  node_number_theory["Number theory services"]
  node_prng_service["Number theory with PRNG"]
  node_prng["Pseudo-random generation"]
  node_ecc_curve["Finite-field elliptic curves"]
  node_ecc_points["Elliptic-curve points"]
  node_discrete_log["Baby-step giant-step"]
end

subgraph group_support["Shared services"]
  node_rsa_requests["RSA request service"]
  node_mv_requests["MV request service"]
  node_dialogs["Dialogs and feedback<br/>[dialogs.service.ts]"]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_app
node_app -.->|"opens"| node_rsa_ui
node_app -.->|"opens"| node_mv_ui
node_app -.->|"opens"| node_math_ui
node_app -.->|"opens"| node_curve_ui
node_rsa_ui -.->|"hosts"| node_rsa_client
node_mv_ui -.->|"hosts"| node_mv_client
node_rsa_client -->|"uses"| node_client_state
node_mv_client -->|"uses"| node_client_state
node_rsa_client -->|"requests"| node_rsa_requests
node_mv_client -->|"requests"| node_mv_requests
node_rsa_client -->|"reports status"| node_dialogs
node_mv_client -->|"reports status"| node_dialogs
node_rsa_requests -.->|"calls over HTTP"| node_rsa_api
node_mv_requests -.->|"calls over HTTP"| node_mv_api
node_api_routes -->|"registers"| node_rsa_api
node_api_routes -->|"registers"| node_mv_api
node_api_routes -->|"registers"| node_math_api
node_rsa_api -->|"uses models"| node_serial_models
node_rsa_api -->|"invokes"| node_rsa_string
node_rsa_string -->|"uses"| node_rsa_core
node_mv_api -->|"generates keys"| node_mv_scheme
node_mv_scheme -->|"uses curve operations"| node_ecc_curve
node_mv_scheme -->|"uses point operations"| node_ecc_points
node_rsa_api -->|"uses"| node_number_theory
node_rsa_string -->|"uses"| node_number_theory
node_prng_service -->|"delegates"| node_prng
node_prng -->|"tests primes"| node_number_theory
node_ecc_curve -->|"operates on"| node_ecc_points
node_ecc_curve -->|"uses"| node_number_theory
node_ecc_points -->|"computes inverses"| node_number_theory
node_math_api -.->|"uses"| node_number_theory

click node_app "https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/app.component.ts"
click node_rsa_ui "https://github.com/tristan-h11/kryptographie/tree/master/GUI/src/app/encryption-components/rsa"
click node_mv_ui "https://github.com/tristan-h11/kryptographie/tree/master/GUI/src/app/encryption-components/menezes-vanstone"
click node_math_ui "https://github.com/tristan-h11/kryptographie/tree/master/GUI/src/app/math-components"
click node_curve_ui "https://github.com/tristan-h11/kryptographie/tree/master/GUI/src/app/display-curve"
click node_client_state "https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/encryption-components/shared/ClientData.ts"
click node_rsa_client "https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/encryption-components/rsa/rsa-client-panel/rsa-client-panel.component.ts"
click node_mv_client "https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/encryption-components/menezes-vanstone/mv-client-panel/mv-client-panel.component.ts"
click node_rsa_requests "https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/services/backend-api/rsa-backend-request.service.ts"
click node_mv_requests "https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/services/backend-api/mv-backend-request.service.ts"
click node_dialogs "https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/services/utility/dialogs.service.ts"
click node_api_routes "https://github.com/tristan-h11/kryptographie/blob/master/src/api/basic.rs"
click node_rsa_api "https://github.com/tristan-h11/kryptographie/blob/master/src/api/endpoints/rsa.rs"
click node_mv_api "https://github.com/tristan-h11/kryptographie/blob/master/src/api/endpoints/mv.rs"
click node_math_api "https://github.com/tristan-h11/kryptographie/blob/master/src/api/endpoints/math_endpoints.rs"
click node_serial_models "https://github.com/tristan-h11/kryptographie/blob/master/src/api/serializable_models.rs"
click node_rsa_string "https://github.com/tristan-h11/kryptographie/blob/master/src/encryption/string_schemes/rsa/rsa_with_string_scheme.rs"
click node_rsa_core "https://github.com/tristan-h11/kryptographie/blob/master/src/encryption/core/rsa/rsa_scheme.rs"
click node_mv_scheme "https://github.com/tristan-h11/kryptographie/blob/master/src/encryption/core/menezes_vanstone/menezes_vanstone_scheme.rs"
click node_elgamal "https://github.com/tristan-h11/kryptographie/tree/master/src/encryption/core/el_gamal"
click node_ggh "https://github.com/tristan-h11/kryptographie/blob/master/src/encryption/core/ggh/ggh_integer.rs"
click node_string_conversion "https://github.com/tristan-h11/kryptographie/tree/master/src/encryption/string_schemes/decimal_unicode_schemes"
click node_number_theory "https://github.com/tristan-h11/kryptographie/blob/master/src/math_core/number_theory/number_theory_service.rs"
click node_prng_service "https://github.com/tristan-h11/kryptographie/blob/master/src/math_core/number_theory_with_prng_service.rs"
click node_prng "https://github.com/tristan-h11/kryptographie/blob/master/src/math_core/pseudo_random_number_generator.rs"
click node_ecc_curve "https://github.com/tristan-h11/kryptographie/blob/master/src/math_core/ecc/secure_finite_field_elliptic_curve.rs"
click node_ecc_points "https://github.com/tristan-h11/kryptographie/blob/master/src/math_core/ecc/finite_field_elliptic_curve_point.rs"
click node_discrete_log "https://github.com/tristan-h11/kryptographie/blob/master/src/math_core/babystep_giantstep.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_app,node_rsa_ui,node_mv_ui,node_math_ui,node_curve_ui,node_client_state,node_rsa_client,node_mv_client toneBlue
class node_api_routes,node_rsa_api,node_mv_api,node_math_api,node_serial_models toneAmber
class node_rsa_string,node_rsa_core,node_mv_scheme,node_elgamal,node_ggh,node_string_conversion toneMint
class node_number_theory,node_prng_service,node_prng,node_ecc_curve,node_ecc_points,node_discrete_log toneRose
class node_rsa_requests,node_mv_requests,node_dialogs,node_learner toneIndigo
```

## Components

### Learning interface

- [Application shell](https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/app.component.ts): `GUI/src/app/app.component.ts`
- [RSA workspace](https://github.com/tristan-h11/kryptographie/tree/master/GUI/src/app/encryption-components/rsa): `GUI/src/app/encryption-components/rsa`
- [Menezes–Vanstone workspace](https://github.com/tristan-h11/kryptographie/tree/master/GUI/src/app/encryption-components/menezes-vanstone): `GUI/src/app/encryption-components/menezes-vanstone`
- [Math demonstrations](https://github.com/tristan-h11/kryptographie/tree/master/GUI/src/app/math-components): `GUI/src/app/math-components`
- [Curve display](https://github.com/tristan-h11/kryptographie/tree/master/GUI/src/app/display-curve): `GUI/src/app/display-curve`
- [Client and message state](https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/encryption-components/shared/ClientData.ts): `GUI/src/app/encryption-components/shared/ClientData.ts`
- [RSA client actions](https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/encryption-components/rsa/rsa-client-panel/rsa-client-panel.component.ts): `GUI/src/app/encryption-components/rsa/rsa-client-panel/rsa-client-panel.component.ts`
- [MV client actions](https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/encryption-components/menezes-vanstone/mv-client-panel/mv-client-panel.component.ts): `GUI/src/app/encryption-components/menezes-vanstone/mv-client-panel/mv-client-panel.component.ts`

### Backend API

- [API route setup](https://github.com/tristan-h11/kryptographie/blob/master/src/api/basic.rs): `src/api/basic.rs`
- [RSA endpoints](https://github.com/tristan-h11/kryptographie/blob/master/src/api/endpoints/rsa.rs): `src/api/endpoints/rsa.rs`
- [MV endpoints](https://github.com/tristan-h11/kryptographie/blob/master/src/api/endpoints/mv.rs): `src/api/endpoints/mv.rs`
- [Math endpoints](https://github.com/tristan-h11/kryptographie/blob/master/src/api/endpoints/math_endpoints.rs): `src/api/endpoints/math_endpoints.rs`
- [Serializable API models](https://github.com/tristan-h11/kryptographie/blob/master/src/api/serializable_models.rs): `src/api/serializable_models.rs`

### Cryptographic schemes

- [RSA string encryption and signatures](https://github.com/tristan-h11/kryptographie/blob/master/src/encryption/string_schemes/rsa/rsa_with_string_scheme.rs): `src/encryption/string_schemes/rsa/rsa_with_string_scheme.rs`
- [RSA core scheme](https://github.com/tristan-h11/kryptographie/blob/master/src/encryption/core/rsa/rsa_scheme.rs): `src/encryption/core/rsa/rsa_scheme.rs`
- [Menezes–Vanstone scheme](https://github.com/tristan-h11/kryptographie/blob/master/src/encryption/core/menezes_vanstone/menezes_vanstone_scheme.rs): `src/encryption/core/menezes_vanstone/menezes_vanstone_scheme.rs`
- [ElGamal variants](https://github.com/tristan-h11/kryptographie/tree/master/src/encryption/core/el_gamal): `src/encryption/core/el_gamal`
- [GGH integer scheme](https://github.com/tristan-h11/kryptographie/blob/master/src/encryption/core/ggh/ggh_integer.rs): `src/encryption/core/ggh/ggh_integer.rs`
- [Decimal Unicode conversion](https://github.com/tristan-h11/kryptographie/tree/master/src/encryption/string_schemes/decimal_unicode_schemes): `src/encryption/string_schemes/decimal_unicode_schemes`

### Math foundations

- [Number theory services](https://github.com/tristan-h11/kryptographie/blob/master/src/math_core/number_theory/number_theory_service.rs): `src/math_core/number_theory/number_theory_service.rs`
- [Number theory with PRNG](https://github.com/tristan-h11/kryptographie/blob/master/src/math_core/number_theory_with_prng_service.rs): `src/math_core/number_theory_with_prng_service.rs`
- [Pseudo-random generation](https://github.com/tristan-h11/kryptographie/blob/master/src/math_core/pseudo_random_number_generator.rs): `src/math_core/pseudo_random_number_generator.rs`
- [Finite-field elliptic curves](https://github.com/tristan-h11/kryptographie/blob/master/src/math_core/ecc/secure_finite_field_elliptic_curve.rs): `src/math_core/ecc/secure_finite_field_elliptic_curve.rs`
- [Elliptic-curve points](https://github.com/tristan-h11/kryptographie/blob/master/src/math_core/ecc/finite_field_elliptic_curve_point.rs): `src/math_core/ecc/finite_field_elliptic_curve_point.rs`
- [Baby-step giant-step](https://github.com/tristan-h11/kryptographie/blob/master/src/math_core/babystep_giantstep.rs): `src/math_core/babystep_giantstep.rs`

### Shared services

- [RSA request service](https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/services/backend-api/rsa-backend-request.service.ts): `GUI/src/app/services/backend-api/rsa-backend-request.service.ts`
- [MV request service](https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/services/backend-api/mv-backend-request.service.ts): `GUI/src/app/services/backend-api/mv-backend-request.service.ts`
- [Dialogs and feedback](https://github.com/tristan-h11/kryptographie/blob/master/GUI/src/app/services/utility/dialogs.service.ts): `GUI/src/app/services/utility/dialogs.service.ts`

### Other components

- **Learner**

## Connections

- Learner → Application shell: uses (evidence: `README.md`)
- Application shell → RSA workspace: opens
- Application shell → Menezes–Vanstone workspace: opens
- Application shell → Math demonstrations: opens
- Application shell → Curve display: opens
- RSA workspace → RSA client actions: hosts
- Menezes–Vanstone workspace → MV client actions: hosts
- RSA client actions → Client and message state: uses (evidence: `GUI/src/app/encryption-components/rsa/rsa-client-panel/rsa-client-panel.component.ts`)
- MV client actions → Client and message state: uses (evidence: `GUI/src/app/encryption-components/menezes-vanstone/mv-client-panel/mv-client-panel.component.ts`)
- RSA client actions → RSA request service: requests (evidence: `GUI/src/app/encryption-components/rsa/rsa-client-panel/rsa-client-panel.component.ts`)
- MV client actions → MV request service: requests (evidence: `GUI/src/app/encryption-components/menezes-vanstone/mv-client-panel/mv-client-panel.component.ts`)
- RSA client actions → Dialogs and feedback: reports status (evidence: `GUI/src/app/encryption-components/rsa/rsa-client-panel/rsa-client-panel.component.ts`)
- MV client actions → Dialogs and feedback: reports status (evidence: `GUI/src/app/encryption-components/menezes-vanstone/mv-client-panel/mv-client-panel.component.ts`)
- RSA request service → RSA endpoints: calls over HTTP
- MV request service → MV endpoints: calls over HTTP
- API route setup → RSA endpoints: registers (evidence: `src/api/basic.rs`)
- API route setup → MV endpoints: registers (evidence: `src/api/basic.rs`)
- API route setup → Math endpoints: registers (evidence: `src/api/basic.rs`)
- RSA endpoints → Serializable API models: uses models (evidence: `src/api/endpoints/rsa.rs`)
- RSA endpoints → RSA string encryption and signatures: invokes (evidence: `src/api/endpoints/rsa.rs`)
- RSA string encryption and signatures → RSA core scheme: uses (evidence: `src/encryption/string_schemes/rsa/rsa_with_string_scheme.rs`)
- MV endpoints → Menezes–Vanstone scheme: generates keys (evidence: `src/api/endpoints/mv.rs`)
- Menezes–Vanstone scheme → Finite-field elliptic curves: uses curve operations (evidence: `src/encryption/core/menezes_vanstone/menezes_vanstone_scheme.rs`)
- Menezes–Vanstone scheme → Elliptic-curve points: uses point operations (evidence: `src/encryption/core/menezes_vanstone/menezes_vanstone_scheme.rs`)
- RSA endpoints → Number theory services: uses (evidence: `src/api/endpoints/rsa.rs`)
- RSA string encryption and signatures → Number theory services: uses (evidence: `src/encryption/string_schemes/rsa/rsa_with_string_scheme.rs`)
- Number theory with PRNG → Pseudo-random generation: delegates (evidence: `src/math_core/number_theory_with_prng_service.rs`)
- Pseudo-random generation → Number theory services: tests primes (evidence: `src/math_core/pseudo_random_number_generator.rs`)
- Finite-field elliptic curves → Elliptic-curve points: operates on (evidence: `src/math_core/ecc/secure_finite_field_elliptic_curve.rs`)
- Finite-field elliptic curves → Number theory services: uses (evidence: `src/math_core/ecc/secure_finite_field_elliptic_curve.rs`)
- Elliptic-curve points → Number theory services: computes inverses (evidence: `src/math_core/ecc/finite_field_elliptic_curve_point.rs`)
- Math endpoints → Number theory services: uses
