# seababy-i/pcap-network-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/seababy-i/pcap-network-analysis
- Repository: https://github.com/seababy-i/pcap-network-analysis

## Overview

This is a small PCAP evidence-security and forensic-analysis tool. Its documented workflow is to hash and sign capture evidence, parse packet information, store extracted data, run heuristic detection, and verify integrity. In the sampled code, security and detection are separate script-driven capabilities; `parser_backup.py` prints parsed packet details, and no database implementation or integrated workflow is present. Dashed README-backed links show the documented workflow, not verified runtime calls; sample-PCAP generators and data files are omitted.

Main entry points: [`crypto_utils.py`](https://github.com/seababy-i/pcap-network-analysis/blob/master/crypto_utils.py) (Hash and signing), [`verify_evidence.py`](https://github.com/seababy-i/pcap-network-analysis/blob/master/verify_evidence.py) (Verification script), [`run_security.py`](https://github.com/seababy-i/pcap-network-analysis/blob/master/run_security.py) (Security runner), [`detection.py`](https://github.com/seababy-i/pcap-network-analysis/blob/master/detection.py) (Port-scan detector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_security["Evidence security"]
  node_security_runner["Security runner<br/>[run_security.py]"]
  node_crypto["Hash and signing<br/>[crypto_utils.py]"]
end

subgraph group_analysis["Forensic analysis"]
  node_parser["Packet parser<br/>[parser_backup.py]"]
  node_database[("Forensic database")]
  node_detector["Port-scan detector<br/>[detection.py]"]
end

subgraph group_verification["Evidence verification"]
  node_verify_script["Verification script<br/>[verify_evidence.py]"]
  node_evidence_store[("Keys and signatures<br/>[crypto_utils.py]")]
end

node_analyst(("Investigator"))
node_evidence["PCAP evidence"]
node_results["Investigation results"]

node_analyst -.->|"runs"| node_security_runner
node_evidence -.->|"secures"| node_security_runner
node_security_runner -->|"calls"| node_crypto
node_crypto -->|"hashes and signs"| node_evidence
node_crypto -->|"writes keys and signature"| node_evidence_store
node_evidence -.->|"parses"| node_parser
node_parser -.->|"stores extracted data"| node_database
node_database -.->|"feeds analysis"| node_detector
node_evidence -->|"scans ports in"| node_detector
node_analyst -.->|"runs"| node_verify_script
node_verify_script -->|"loads public key and signature"| node_evidence_store
node_verify_script -->|"calls verification"| node_crypto
node_crypto -->|"verifies signature"| node_evidence
node_detector -->|"reports alerts"| node_results
node_verify_script -->|"reports validity"| node_results

click node_security_runner "https://github.com/seababy-i/pcap-network-analysis/blob/master/run_security.py"
click node_crypto "https://github.com/seababy-i/pcap-network-analysis/blob/master/crypto_utils.py"
click node_parser "https://github.com/seababy-i/pcap-network-analysis/blob/master/parser_backup.py"
click node_detector "https://github.com/seababy-i/pcap-network-analysis/blob/master/detection.py"
click node_verify_script "https://github.com/seababy-i/pcap-network-analysis/blob/master/verify_evidence.py"
click node_evidence_store "https://github.com/seababy-i/pcap-network-analysis/blob/master/crypto_utils.py"

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_security_runner,node_crypto toneBlue
class node_parser,node_database,node_detector toneAmber
class node_verify_script,node_evidence_store toneMint
class node_analyst,node_evidence,node_results toneIndigo
```

## Components

### Evidence security

- [Security runner](https://github.com/seababy-i/pcap-network-analysis/blob/master/run_security.py): `run_security.py`
- [Hash and signing](https://github.com/seababy-i/pcap-network-analysis/blob/master/crypto_utils.py): `crypto_utils.py`

### Forensic analysis

- [Packet parser](https://github.com/seababy-i/pcap-network-analysis/blob/master/parser_backup.py): `parser_backup.py`
- **Forensic database**
- [Port-scan detector](https://github.com/seababy-i/pcap-network-analysis/blob/master/detection.py): `detection.py`

### Evidence verification

- [Verification script](https://github.com/seababy-i/pcap-network-analysis/blob/master/verify_evidence.py): `verify_evidence.py`
- [Keys and signatures](https://github.com/seababy-i/pcap-network-analysis/blob/master/crypto_utils.py): `crypto_utils.py`

### Other components

- **Investigator**
- **PCAP evidence**
- **Investigation results**

## Connections

- Investigator → Security runner: runs (evidence: `readme.md`)
- PCAP evidence → Security runner: secures (evidence: `readme.md`)
- Security runner → Hash and signing: calls (evidence: `run_security.py`)
- Hash and signing → PCAP evidence: hashes and signs (evidence: `crypto_utils.py`)
- Hash and signing → Keys and signatures: writes keys and signature (evidence: `crypto_utils.py`)
- PCAP evidence → Packet parser: parses (evidence: `readme.md`)
- Packet parser → Forensic database: stores extracted data (evidence: `readme.md`)
- Forensic database → Port-scan detector: feeds analysis (evidence: `readme.md`)
- PCAP evidence → Port-scan detector: scans ports in (evidence: `detection.py`)
- Investigator → Verification script: runs (evidence: `readme.md`)
- Verification script → Keys and signatures: loads public key and signature (evidence: `verify_evidence.py`)
- Verification script → Hash and signing: calls verification (evidence: `verify_evidence.py`)
- Hash and signing → PCAP evidence: verifies signature (evidence: `crypto_utils.py`)
- Port-scan detector → Investigation results: reports alerts (evidence: `detection.py`)
- Verification script → Investigation results: reports validity (evidence: `verify_evidence.py`)
