# uitxwoodynguyen/ecc-from-scratch-digital-signatures architecture

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

- Interactive diagram: https://gitdiagram.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures
- Repository: https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures

## Overview

This is an ECC and digital-signature suite with a CLI, a C API, and a PyQt desktop interface. Users can generate and inspect keys, perform curve operations, encrypt or decrypt files, and sign or verify them; the interfaces dispatch those requests to cryptographic implementations. Separate capabilities include educational attack demonstrations, ECDH/X25519, and authenticated seal/open containers. The graph preserves these documented branches. Source-index references and excerpts support the shown connections; unsampled implementation details are not inferred.

Main entry points: [`src/main.cpp`](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/main.cpp) (CLI dispatcher), [`src/ec_keys.cpp`](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/ec_keys.cpp) (Key management), [`src/c_api.cpp`](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/c_api.cpp) (C API), [`src/sigfile.cpp`](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/sigfile.cpp) (L3SG containers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI dispatcher<br/>[main.cpp]"]
  node_gui["Desktop GUI<br/>[main.py]"]
  node_pybridge["Python bindings<br/>[crypto_core.py]"]
  node_capi["C API<br/>[c_api.cpp]"]
end

subgraph group_keys_curves["Keys and curves"]
  node_keymgmt["Key management<br/>[ec_keys.cpp]"]
  node_ecmath["EC arithmetic<br/>[ec_math.cpp]"]
  node_x25519["ECDH / X25519<br/>[x25519_edu.cpp]"]
end

subgraph group_encryption["Encryption"]
  node_ecies["ECIES containers<br/>[ecies.cpp]"]
  node_seal["Seal and open<br/>[seal_open.cpp]"]
end

subgraph group_signatures["Signatures"]
  node_sigfile["L3SG containers<br/>[sigfile.cpp]"]
  node_rsasig["RSA signatures<br/>[rsa_sig.cpp]"]
  node_ecdsasig["ECDSA<br/>[ecdsa.cpp]"]
  node_eddsa["EdDSA<br/>[eddsa.cpp]"]
end

subgraph group_foundation["Shared foundation"]
  node_common["Crypto utilities<br/>[common.cpp]"]
end

node_user(("User"))
node_openssl["OpenSSL"]

node_user -->|"runs commands"| node_cli
node_user -->|"uses"| node_gui
node_gui -->|"calls wrappers"| node_pybridge
node_pybridge -->|"calls DLL API"| node_capi
node_cli -->|"dispatches curve ops"| node_ecmath
node_cli -->|"dispatches key ops"| node_keymgmt
node_cli -->|"dispatches key agreement"| node_x25519
node_cli -->|"dispatches encryption"| node_ecies
node_cli -->|"dispatches sign/verify"| node_sigfile
node_cli -->|"dispatches RSA demo"| node_rsasig
node_cli -->|"dispatches ECDSA"| node_ecdsasig
node_cli -->|"dispatches EdDSA"| node_eddsa
node_cli -->|"dispatches seal/open"| node_seal
node_capi -->|"calls key operations"| node_keymgmt
node_capi -->|"calls curve operations"| node_ecmath
node_capi -->|"calls self-tests"| node_x25519
node_capi -->|"calls encryption"| node_ecies
node_capi -->|"calls signing"| node_sigfile
node_capi -->|"calls seal/open"| node_seal
node_ecmath -->|"uses utilities"| node_common
node_keymgmt -->|"uses utilities"| node_common
node_x25519 -->|"uses curve operations"| node_ecmath
node_x25519 -->|"uses key handling"| node_keymgmt
node_ecies -->|"uses key handling"| node_keymgmt
node_ecies -->|"uses curve operations"| node_ecmath
node_sigfile -->|"uses key handling"| node_keymgmt
node_sigfile -->|"dispatches RSA signing"| node_rsasig
node_sigfile -->|"dispatches ECDSA signing"| node_ecdsasig
node_sigfile -->|"dispatches EdDSA signing"| node_eddsa
node_ecdsasig -->|"uses key handling"| node_keymgmt
node_eddsa -->|"uses key handling"| node_keymgmt
node_seal -->|"uses signature format"| node_sigfile
node_seal -->|"uses encryption"| node_ecies
node_seal -->|"uses key handling"| node_keymgmt
node_ecmath -->|"uses crypto library"| node_openssl
node_common -->|"uses crypto library"| node_openssl

click node_cli "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/main.cpp"
click node_gui "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/GUI/main.py"
click node_pybridge "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/GUI/crypto_core.py"
click node_capi "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/c_api.cpp"
click node_keymgmt "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/ec_keys.cpp"
click node_ecmath "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/ec_math.cpp"
click node_x25519 "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/x25519_edu.cpp"
click node_ecies "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/ecies.cpp"
click node_seal "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/seal_open.cpp"
click node_sigfile "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/sigfile.cpp"
click node_rsasig "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/rsa_sig.cpp"
click node_ecdsasig "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/ecdsa.cpp"
click node_eddsa "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/eddsa.cpp"
click node_common "https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/common.cpp"

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_cli,node_gui,node_pybridge,node_capi,node_user toneBlue
class node_keymgmt,node_ecmath,node_x25519 toneAmber
class node_ecies,node_seal toneMint
class node_sigfile,node_rsasig,node_ecdsasig,node_eddsa toneRose
class node_common,node_openssl toneIndigo
```

## Components

### User interfaces

- [CLI dispatcher](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/main.cpp): `src/main.cpp`
- [Desktop GUI](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/GUI/main.py): `GUI/main.py`
- [Python bindings](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/GUI/crypto_core.py): `GUI/crypto_core.py`
- [C API](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/c_api.cpp): `src/c_api.cpp`

### Keys and curves

- [Key management](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/ec_keys.cpp): `src/ec_keys.cpp`
- [EC arithmetic](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/ec_math.cpp): `src/ec_math.cpp`
- [ECDH / X25519](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/x25519_edu.cpp): `src/x25519_edu.cpp`

### Encryption

- [ECIES containers](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/ecies.cpp): `src/ecies.cpp`
- [Seal and open](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/seal_open.cpp): `src/seal_open.cpp`

### Signatures

- [L3SG containers](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/sigfile.cpp): `src/sigfile.cpp`
- [RSA signatures](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/rsa_sig.cpp): `src/rsa_sig.cpp`
- [ECDSA](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/ecdsa.cpp): `src/ecdsa.cpp`
- [EdDSA](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/eddsa.cpp): `src/eddsa.cpp`

### Shared foundation

- [Crypto utilities](https://github.com/uitxwoodynguyen/ecc-from-scratch-digital-signatures/blob/main/src/common.cpp): `src/common.cpp`

### Other components

- **User**
- **OpenSSL**

## Connections

- User → CLI dispatcher: runs commands (evidence: `src/main.cpp`)
- User → Desktop GUI: uses (evidence: `README.md`)
- Desktop GUI → Python bindings: calls wrappers (evidence: `GUI/main.py`)
- Python bindings → C API: calls DLL API (evidence: `GUI/crypto_core.py`)
- CLI dispatcher → EC arithmetic: dispatches curve ops (evidence: `src/main.cpp`)
- CLI dispatcher → Key management: dispatches key ops (evidence: `src/main.cpp`)
- CLI dispatcher → ECDH / X25519: dispatches key agreement (evidence: `src/main.cpp`)
- CLI dispatcher → ECIES containers: dispatches encryption (evidence: `src/main.cpp`)
- CLI dispatcher → L3SG containers: dispatches sign/verify (evidence: `src/main.cpp`)
- CLI dispatcher → RSA signatures: dispatches RSA demo (evidence: `src/main.cpp`)
- CLI dispatcher → ECDSA: dispatches ECDSA (evidence: `src/main.cpp`)
- CLI dispatcher → EdDSA: dispatches EdDSA (evidence: `src/main.cpp`)
- CLI dispatcher → Seal and open: dispatches seal/open (evidence: `src/main.cpp`)
- C API → Key management: calls key operations (evidence: `src/c_api.cpp`)
- C API → EC arithmetic: calls curve operations (evidence: `src/c_api.cpp`)
- C API → ECDH / X25519: calls self-tests (evidence: `src/c_api.cpp`)
- C API → ECIES containers: calls encryption (evidence: `src/c_api.cpp`)
- C API → L3SG containers: calls signing (evidence: `src/c_api.cpp`)
- C API → Seal and open: calls seal/open (evidence: `src/c_api.cpp`)
- EC arithmetic → Crypto utilities: uses utilities (evidence: `src/ec_math.cpp`)
- Key management → Crypto utilities: uses utilities (evidence: `src/ec_keys.cpp`)
- ECDH / X25519 → EC arithmetic: uses curve operations (evidence: `src/x25519_edu.cpp`)
- ECDH / X25519 → Key management: uses key handling (evidence: `src/x25519_edu.cpp`)
- ECIES containers → Key management: uses key handling (evidence: `src/ecies.cpp`)
- ECIES containers → EC arithmetic: uses curve operations (evidence: `src/ecies.cpp`)
- L3SG containers → Key management: uses key handling (evidence: `src/sigfile.cpp`)
- L3SG containers → RSA signatures: dispatches RSA signing (evidence: `src/sigfile.cpp`)
- L3SG containers → ECDSA: dispatches ECDSA signing (evidence: `src/sigfile.cpp`)
- L3SG containers → EdDSA: dispatches EdDSA signing (evidence: `src/sigfile.cpp`)
- ECDSA → Key management: uses key handling (evidence: `src/ecdsa.cpp`)
- EdDSA → Key management: uses key handling (evidence: `src/eddsa.cpp`)
- Seal and open → L3SG containers: uses signature format (evidence: `src/seal_open.cpp`)
- Seal and open → ECIES containers: uses encryption (evidence: `src/seal_open.cpp`)
- Seal and open → Key management: uses key handling (evidence: `src/seal_open.cpp`)
- EC arithmetic → OpenSSL: uses crypto library
- Crypto utilities → OpenSSL: uses crypto library
