Skip to content

About

Secure Data Pipeline - End-to-end encrypted data pipeline with AES-256-GCM, RSA key wrapping, Ed25519 signing, audit trail, and data lineage

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

πŸ” CryptaPipe

CI Python 3.11+ License: MIT Ruff Security: AES-256-GCM

End-to-end encrypted secure data pipeline with tamper-evident audit logging and data lineage tracking.


Features

  • End-to-End Encryption β€” AES-256-GCM content encryption with RSA-OAEP key wrapping
  • Cryptographic Signing β€” Ed25519 signatures for non-repudiation
  • Key Management β€” Automatic key generation, rotation, and secure storage with PBKDF2
  • Tamper-Evident Audit β€” Blockchain-style chained SHA-256 hash log
  • Data Lineage β€” Full provenance graph tracking every source, transform, and sink
  • FastAPI Management API β€” RESTful control plane
  • Async Pipeline β€” Producer β†’ Processor β†’ Consumer via Redis Streams
  • Docker Compose β€” One-command deployment with Redis

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Producer │───▢│ Processor │───▢│ Consumer β”‚
β”‚ (encrypt β”‚    β”‚ (metadata β”‚    β”‚ (decrypt β”‚
β”‚  + sign) β”‚    β”‚   only)   β”‚    β”‚  + sink) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
     β”‚                β”‚                β”‚
     β–Ό                β–Ό                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚            Redis Streams                β”‚
β”‚         (encrypted payloads)            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
     β”‚                β”‚                β”‚
     β–Ό                β–Ό                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Audit Log (chained hash)        β”‚
β”‚         Lineage Graph (provenance)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Quick Start

# 1. Clone and install
git clone https://github.com/janderik/crypta-pipe.git
cd crypta-pipe
pip install -r requirements.txt

# 2. Start Redis (optional, for pipeline)
docker compose up -d redis

# 3. Start the API server
python -m src.main serve --reload

# 4. Run the example
python examples/sample_pipeline.py

Using Docker Compose

docker compose up --build

The API is available at http://localhost:8000.

API Reference

Method Path Description
GET /api/v1/health Health check
GET /api/v1/keys List encryption keys
POST /api/v1/keys/rotate Rotate active key
POST /api/v1/publish Publish encrypted payload
GET /api/v1/audit Query audit log
GET /api/v1/audit/verify Verify audit chain integrity
GET /api/v1/lineage Get full lineage graph
GET /api/v1/lineage/provenance/{id} Provenance for a node
POST /api/v1/lineage/node Register a lineage node

Publish a Message

curl -s -X POST http://localhost:8000/api/v1/publish \
  -H "Content-Type: application/json" \
  -d '{"payload": {"event": "click", "user": 42}, "source": "web"}'

Response:

{"message_id": "1712345678000-0"}

Project Structure

crypta-pipe/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ crypto/       # AES-256-GCM, RSA-OAEP, Ed25519, KDF
β”‚   β”œβ”€β”€ pipeline/     # Producer/Processor/Consumer
β”‚   β”œβ”€β”€ audit/        # Chained-hash logger + lineage tracker
β”‚   β”œβ”€β”€ api/          # FastAPI server + routes
β”‚   └── main.py       # CLI entrypoint
β”œβ”€β”€ tests/            # Crypto + pipeline tests
β”œβ”€β”€ examples/         # Sample pipeline (no Redis needed)
β”œβ”€β”€ Dockerfile
└── docker-compose.yml

Security

  • AES-256-GCM β€” authenticated encryption with associated data (AAD)
  • RSA-OAEP (4096-bit) β€” secure key wrapping with SHA-256 MGF1
  • Ed25519 β€” high-speed digital signatures
  • PBKDF2-HMAC-SHA256 β€” key derivation with 600,000 iterations
  • Chained Audit β€” each entry includes the SHA-256 hash of the previous entry

Development

pip install ruff mypy pytest pytest-asyncio
ruff check src/ tests/
mypy src/
pytest tests/ -v

License

MIT

About

Secure Data Pipeline - End-to-end encrypted data pipeline with AES-256-GCM, RSA key wrapping, Ed25519 signing, audit trail, and data lineage

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages