# shaharyuval2/ecg-bio-signatures-puf architecture

> Architecture diagram of the GitHub repository shaharyuval2/ecg-bio-signatures-puf, 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/shaharyuval2/ecg-bio-signatures-puf
- Repository: https://github.com/shaharyuval2/ecg-bio-signatures-puf

## Overview

This repository implements an ECG-based biometric fuzzy extractor, with an interactive client/server demo. The intended workflow is ECG input to learned features, quantization and neuron selection, syndrome-based error correction, then SipHash key generation; the demo also supports encrypted message and video transmission. The README establishes these product-level stages, while the source index confirms only selected module references. The graph therefore omits unverified internal call details, especially in the unsampled server and C implementations.

Main entry points: [`app/biometric_app/Feature_Extraction/extract.py`](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Feature_Extraction/extract.py) (Feature extraction app), [`4th year project/aes.c`](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/aes.c) (AES encryption), [`4th year project/one_syndrome.c`](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/one_syndrome.c) (BCH syndrome extractor), [`app/biometric_app/Client Side/app.py`](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Client%20Side/app.py) (Client interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_feature["ECG features"]
  node_feature_app["Feature extraction app<br/>[extract.py]"]
  node_models["Neural models<br/>[models.py]"]
  node_signal_generation["Signal generation<br/>[generateSamples.py]"]
  node_training["Model training"]
  node_analysis["Feature analysis<br/>[analyzeData.py]"]
  node_quantization["Quantization and selection<br/>[extract.py]"]
end

subgraph group_extractor["Key extraction"]
  node_syndrome["BCH syndrome extractor<br/>[one_syndrome.c]"]
  node_dataset["Dataset handling<br/>[DataSet.c]"]
end

subgraph group_demo["Secure demo"]
  node_client_ui["Client interface<br/>[app.py]"]
  node_client_logic["Client module<br/>[client_module.py]"]
  node_server_ui["Server interface"]
  node_server_logic["Server module<br/>[server_module.py]"]
  node_network_client["C client<br/>[Client.c]"]
  node_network_server["C server<br/>[Server.c]"]
end

subgraph group_crypto["Cryptographic primitives"]
  node_hash["SipHash<br/>[siphash.c]"]
  node_aes["AES encryption<br/>[aes.c]"]
end

node_user(("User"))
node_ecg["ECG signals"]

node_user -->|"uses"| node_client_ui
node_ecg -->|"extracts features"| node_feature_app
node_signal_generation -->|"supplies signals"| node_feature_app
node_feature_app -->|"uses model"| node_models
node_training -->|"trains"| node_models
node_feature_app -->|"quantizes features"| node_quantization
node_analysis -.->|"supports selection"| node_quantization
node_quantization -->|"feeds fuzzy extractor"| node_syndrome
node_syndrome -->|"uses data"| node_dataset
node_syndrome -->|"compresses key"| node_hash
node_client_ui -->|"delegates to"| node_client_logic
node_client_ui -->|"communicates"| node_server_ui
node_server_ui -.->|"delegates to"| node_server_logic
node_client_logic -->|"encrypts traffic"| node_aes
node_server_logic -->|"decrypts traffic"| node_aes
node_network_client -->|"communicates"| node_network_server
node_network_client -.->|"uses encryption"| node_aes
node_network_server -.->|"uses encryption"| node_aes

click node_client_ui "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Client%20Side/app.py"
click node_client_logic "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Client%20Side/client_module.py"
click node_server_ui "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Server%20Side/server_streamlit.py"
click node_server_logic "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Server%20Side/server_module.py"
click node_feature_app "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Feature_Extraction/extract.py"
click node_models "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Feature_Extraction/models.py"
click node_signal_generation "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/feature%20extraction/FeatureExtraction/generateSamples.py"
click node_training "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/feature%20extraction/FeatureExtraction/Create_and_train.py"
click node_analysis "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/feature%20extraction/FeatureExtraction/analyzeData.py"
click node_quantization "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/feature%20extraction/FeatureExtraction/extract.py"
click node_syndrome "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/one_syndrome.c"
click node_dataset "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/DataSet.c"
click node_hash "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/siphash.c"
click node_aes "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/aes.c"
click node_network_client "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/Client.c"
click node_network_server "https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/Server.c"

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_feature_app,node_models,node_signal_generation,node_training,node_analysis,node_quantization,node_user toneBlue
class node_syndrome,node_dataset toneAmber
class node_client_ui,node_client_logic,node_server_ui,node_server_logic,node_network_client,node_network_server toneMint
class node_hash,node_aes toneRose
class node_ecg toneIndigo
```

## Components

### ECG features

- [Feature extraction app](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Feature_Extraction/extract.py): `app/biometric_app/Feature_Extraction/extract.py`
- [Neural models](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Feature_Extraction/models.py): `app/biometric_app/Feature_Extraction/models.py`
- [Signal generation](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/feature%20extraction/FeatureExtraction/generateSamples.py): `feature extraction/FeatureExtraction/generateSamples.py`
- [Model training](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/feature%20extraction/FeatureExtraction/Create_and_train.py): `feature extraction/FeatureExtraction/Create_and_train.py`
- [Feature analysis](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/feature%20extraction/FeatureExtraction/analyzeData.py): `feature extraction/FeatureExtraction/analyzeData.py`
- [Quantization and selection](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/feature%20extraction/FeatureExtraction/extract.py): `feature extraction/FeatureExtraction/extract.py`

### Key extraction

- [BCH syndrome extractor](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/one_syndrome.c): `4th year project/one_syndrome.c`
- [Dataset handling](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/DataSet.c): `4th year project/DataSet.c`

### Secure demo

- [Client interface](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Client%20Side/app.py): `app/biometric_app/Client Side/app.py`
- [Client module](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Client%20Side/client_module.py): `app/biometric_app/Client Side/client_module.py`
- [Server interface](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Server%20Side/server_streamlit.py): `app/biometric_app/Server Side/server_streamlit.py`
- [Server module](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/app/biometric_app/Server%20Side/server_module.py): `app/biometric_app/Server Side/server_module.py`
- [C client](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/Client.c): `4th year project/Client.c`
- [C server](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/Server.c): `4th year project/Server.c`

### Cryptographic primitives

- [SipHash](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/siphash.c): `4th year project/siphash.c`
- [AES encryption](https://github.com/shaharyuval2/ecg-bio-signatures-puf/blob/main/4th%20year%20project/aes.c): `4th year project/aes.c`

### Other components

- **User**
- **ECG signals**

## Connections

- User → Client interface: uses
- ECG signals → Feature extraction app: extracts features
- Signal generation → Feature extraction app: supplies signals
- Feature extraction app → Neural models: uses model
- Model training → Neural models: trains (evidence: `feature extraction/FeatureExtraction/Create_and_train.py`)
- Feature extraction app → Quantization and selection: quantizes features
- Feature analysis → Quantization and selection: supports selection (evidence: `feature extraction/FeatureExtraction/extract.py`)
- Quantization and selection → BCH syndrome extractor: feeds fuzzy extractor
- BCH syndrome extractor → Dataset handling: uses data (evidence: `4th year project/one_syndrome.c`)
- BCH syndrome extractor → SipHash: compresses key
- Client interface → Client module: delegates to (evidence: `app/biometric_app/Client Side/app.py`)
- Client interface → Server interface: communicates
- Server interface → Server module: delegates to
- Client module → AES encryption: encrypts traffic
- Server module → AES encryption: decrypts traffic
- C client → C server: communicates
- C client → AES encryption: uses encryption
- C server → AES encryption: uses encryption
