How arjun-m-b/hydra works
HYDRA protects synthetic medical records by encrypting them across two peer servers, with key shares held by each server and a client token. The main lifecycle is record preparation and initialization, encrypted storage and mirroring, anomaly detection, then breach-triggered key evolution, re-encryption, failover, isolation, and audit. Users operate the system through the CLI or dashboard; the dashboard also exposes monitoring, audit inspection, cryptography inspection, patient exploration, and breach simulation. README capabilities supplement the partial source excerpts, so uncertain internal wiring is omitted.
Main entry points: server_a/app.py Server A · server_b/app.py Server B · run.py System Launcher · cli.py Command Line
Components 22
Operations and Clients
- System Launcher
run.py - Command Line
client/cli.py - Client Token
client/token.py - Dashboard Core
dashboard/app.js - Dashboard Views
dashboard/pages
Medical Records
- Synthea Records
data/raw/synthea_patients.json - Record Preprocessing
data/preprocess.py - Prepared Records
data/processed/records.json
Dual Server Runtime
- Server A
server_a/app.py - Server B
server_b/app.py - A Record Store
server_a/store.py - B Record Store
server_b/store.py - Peer Heartbeat
heartbeat.py
Security and Recovery
- A Breach Detection
server_a/breach.py - B Breach Detection
server_b/breach.py - Key Ratchet
core/hkdf.py - Record Re-encryption
reencrypt.py - Secret Sharing
core/shamir.py - Failover Proofs
core/zkp.py - Authenticated Encryption
core/xchacha20.py
Monitoring and Audit
- Hash-chain Audit
core/audit.py
Other components
- Operator
Connections 33
- Operator → System Launcher: starts system
- Operator → Command Line: uses commands
- Operator → Dashboard Core: views system
- System Launcher → Server A: starts
- System Launcher → Server B: starts
- System Launcher → Secret Sharing: creates shares
- System Launcher → Prepared Records: loads records
- Synthea Records → Record Preprocessing: normalizes
- Record Preprocessing → Prepared Records: writes
- Command Line → Server A: calls API
- Command Line → Server B: fails over
- Command Line → Client Token: uses token
- Dashboard Core → Server A: polls API
- Dashboard Core → Server B: polls API
- Dashboard Views → Dashboard Core: uses API
- Server A → A Record Store: reads and writes
- Server B → B Record Store: reads and writes
- Server A → Server B: mirrors records
- Server B → Server A: syncs records
- Peer Heartbeat → Server A: synchronizes
- Peer Heartbeat → Server B: synchronizes
- Server A → A Breach Detection: updates score
- Server B → B Breach Detection: updates score
- Server A → Key Ratchet: derives key
- Server B → Key Ratchet: derives key
- Server A → Record Re-encryption: re-encrypts records
- Server B → Record Re-encryption: re-encrypts records
- Server A → Failover Proofs: verifies promotion
- Server B → Failover Proofs: proves share
- Server A → Authenticated Encryption: encrypts records
- Server B → Authenticated Encryption: encrypts records
- Server A → Hash-chain Audit: records events
- Server B → Hash-chain Audit: records events